@@ -7,21 +7,29 @@ use std::{fmt, path::PathBuf};
77
88use crate :: { constants, log, options, tunnels:: code_server:: CodeServerArgs } ;
99use clap:: { ArgEnum , Args , Parser , Subcommand } ;
10+ use const_format:: concatcp;
1011
11- const TEMPLATE : & str = "
12- Visual Studio Code CLI - {version}
12+ const CLI_NAME : & str = concatcp ! ( constants:: PRODUCT_NAME_LONG , " CLI" ) ;
13+ const TEMPLATE : & str = concatcp ! (
14+ CLI_NAME ,
15+ " - {version}
1316
14- Usage: code-insiders.exe [options][paths...]
17+ Usage: " ,
18+ constants:: APPLICATION_NAME ,
19+ " [options][paths...]
1520
16- To read output from another program, append '-' (e.g. 'echo Hello World | code-insiders.exe -')
21+ To read output from another program, append '-' (e.g. 'echo Hello World | " ,
22+ constants:: APPLICATION_NAME ,
23+ " -')
1724
18- {all-args}" ;
25+ {all-args}"
26+ ) ;
1927
2028#[ derive( Parser , Debug , Default ) ]
2129#[ clap(
2230 help_template = TEMPLATE ,
2331 long_about = None ,
24- name = "Visual Studio Code CLI" ,
32+ name = CLI_NAME ,
2533 version = match constants:: VSCODE_CLI_VERSION { Some ( v) => v, None => "dev" } ,
2634 ) ]
2735pub struct IntegratedCli {
@@ -53,7 +61,7 @@ pub struct CliCore {
5361#[ clap(
5462 help_template = TEMPLATE ,
5563 long_about = None ,
56- name = "Visual Studio Code CLI" ,
64+ name = CLI_NAME ,
5765 version = match constants:: VSCODE_CLI_VERSION { Some ( v) => v, None => "dev" } ,
5866 ) ]
5967pub struct StandaloneCli {
@@ -115,7 +123,7 @@ impl<'a> From<&'a CliCore> for CodeServerArgs {
115123
116124#[ derive( Subcommand , Debug , Clone ) ]
117125pub enum StandaloneCommands {
118- /// Updates the VS Code CLI.
126+ /// Updates the CLI.
119127 Update ( StandaloneUpdateArgs ) ,
120128}
121129
@@ -133,14 +141,14 @@ pub enum Commands {
133141 /// Run `code tunnel --help` for more usage info.
134142 Tunnel ( TunnelArgs ) ,
135143
136- /// Manage VS Code extensions.
144+ /// Manage editor extensions.
137145 #[ clap( name = "ext" ) ]
138146 Extension ( ExtensionArgs ) ,
139147
140148 /// Print process usage and diagnostics information.
141149 Status ,
142150
143- /// Changes the version of VS Code you're using.
151+ /// Changes the version of the editor you're using.
144152 Version ( VersionArgs ) ,
145153}
146154
@@ -251,16 +259,16 @@ pub struct VersionArgs {
251259
252260#[ derive( Subcommand , Debug , Clone ) ]
253261pub enum VersionSubcommand {
254- /// Switches the instance of VS Code in use.
262+ /// Switches the version of the editor in use.
255263 Use ( UseVersionArgs ) ,
256264
257- /// Shows the currently configured VS Code version.
265+ /// Shows the currently configured editor version.
258266 Show ,
259267}
260268
261269#[ derive( Args , Debug , Clone ) ]
262270pub struct UseVersionArgs {
263- /// The version of VS Code you want to use. Can be "stable", "insiders",
271+ /// The version of the editor you want to use. Can be "stable", "insiders",
264272 /// a version number, or an absolute path to an existing install.
265273 #[ clap( value_name = "stable | insiders | x.y.z | path" ) ]
266274 pub name : String ,
@@ -346,19 +354,19 @@ impl EditorOptions {
346354 }
347355}
348356
349- /// Arguments applicable whenever VS Code desktop is launched
357+ /// Arguments applicable whenever the desktop editor is launched
350358#[ derive( Args , Debug , Default , Clone ) ]
351359pub struct DesktopCodeOptions {
352360 /// Set the root path for extensions.
353361 #[ clap( long, value_name = "dir" ) ]
354362 pub extensions_dir : Option < String > ,
355363
356364 /// Specifies the directory that user data is kept in. Can be used to
357- /// open multiple distinct instances of Code .
365+ /// open multiple distinct instances of the editor .
358366 #[ clap( long, value_name = "dir" ) ]
359367 pub user_data_dir : Option < String > ,
360368
361- /// Sets the VS Code version to use for this command. The preferred version
369+ /// Sets the editor version to use for this command. The preferred version
362370 /// can be persisted with `code version use <version>`. Can be "stable",
363371 /// "insiders", a version number, or an absolute path to an existing install.
364372 #[ clap( long, value_name = "stable | insiders | x.y.z | path" ) ]
@@ -386,7 +394,7 @@ impl DesktopCodeOptions {
386394
387395#[ derive( Args , Debug , Default , Clone ) ]
388396pub struct GlobalOptions {
389- /// Directory where CLI metadata, such as VS Code installations, should be stored.
397+ /// Directory where CLI metadata should be stored.
390398 #[ clap( long, env = "VSCODE_CLI_DATA_DIR" , global = true ) ]
391399 pub cli_data_dir : Option < String > ,
392400
@@ -464,7 +472,7 @@ pub struct EditorTroubleshooting {
464472 #[ clap( long, value_name = "memory" ) ]
465473 pub max_memory : Option < usize > ,
466474
467- /// Shows all telemetry events which VS code collects.
475+ /// Shows all telemetry events which the editor collects.
468476 #[ clap( long) ]
469477 pub telemetry : bool ,
470478}
0 commit comments