Repository: denoland/deno
File: cli/args/flags.rs (Rust)

Code before:
        .arg(
          Arg::new("allow-slow-types")
            .long("allow-slow-types")
            .help("Allow publishing with slow types")
            .action(ArgAction::SetTrue)
            .help_heading(PUBLISH_HEADING),
        )
        .arg(
          Arg::new("allow-dirty")
            .long("allow-dirty")
            .help("Allow publishing if the repository has uncommitted changed")
            .action(ArgAction::SetTrue)
            .help_heading(PUBLISH_HEADING),
        )
        .arg(
          Arg::new("no-provenance")
            .long("no-provenance")
            .help(cstr!("Disable provenance attestation.
  <p(245)>Enabled by default on Github actions, publicly links the package to where it was built and published from.</>"))
            .action(ArgAction::SetTrue)
            .help_heading(PUBLISH_HEADING)
        )
        .arg(
          Arg::new("set-version")
            .long("set-version")
            .help("Set the version specified in the configuration file")
            .value_name("VERSION")
            .help_heading(PUBLISH_HEADING)
        )
        .arg(check_arg(/* type checks by default */ true))
        .arg(no_check_arg())
    })
}

fn compile_args(app: Command) -> Command {
  compile_args_without_check_args(app.arg(no_check_arg()))
}

fn compile_args_without_check_args(app: Command) -> Command {
  app
    .arg(import_map_arg())
    .arg(no_remote_arg())
    .arg(no_npm_arg())
    .arg(node_modules_dir_arg())
    .arg(vendor_arg())
    .arg(config_arg())
    .arg(no_config_arg())
    .arg(reload_arg())
    .arg(lock_arg())
    .arg(no_lock_arg())
    .arg(ca_file_arg())

Review comment (suggestion):
```suggestion
            .help("Set version for a package to be published.
             This flag can be used while publishing individual packages and cannot be used in a workspace.")
```

Please suggest better description if possible

Code after:
See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations",
      UnstableArgsConfig::ResolutionOnly
    )
    .hide(true)
}

fn publish_subcommand() -> Command {
  command("publish", "Publish the current working directory's package or workspace to JSR", UnstableArgsConfig::ResolutionOnly)
    .defer(|cmd| {
      cmd
        .arg(
          Arg::new("token")
            .long("token")
            .help("The API token to use when publishing. If unset, interactive authentication is be used")
            .help_heading(PUBLISH_HEADING)
        )
        .arg(config_arg())
        .arg(no_config_arg())
        .arg(
          Arg::new("dry-run")
            .long("dry-run")
            .help("Prepare the package for publishing performing all checks and validations without uploading")
            .action(ArgAction::SetTrue)
            .help_heading(PUBLISH_HEADING),
        )
        .arg(
          Arg::new("allow-slow-types")
            .long("allow-slow-types")
            .help("Allow publishing with slow types")
            .action(ArgAction::SetTrue)
            .help_heading(PUBLISH_HEADING),
        )
        .arg(
          Arg::new("allow-dirty")
            .long("allow-dirty")
            .help("Allow publishing if the repository has uncommitted changed")
            .action(ArgAction::SetTrue)
            .help_heading(PUBLISH_HEADING),
        )
        .arg(
          Arg::new("no-provenance")
            .long("no-provenance")
            .help(cstr!("Disable provenance attestation.
  <p(245)>Enabled by default on Github actions, publicly links the package to where it was built and published from.</>"))
            .action(ArgAction::SetTrue)
            .help_heading(PUBLISH_HEADING)
        )
        .arg(
          Arg::new("set-version")
            .long("set-version")
            .help("Set version for a package to be published.