@@ -7,21 +7,29 @@ use std::{fmt, path::PathBuf};
7
7
8
8
use crate :: { constants, log, options, tunnels:: code_server:: CodeServerArgs } ;
9
9
use clap:: { ArgEnum , Args , Parser , Subcommand } ;
10
+ use const_format:: concatcp;
10
11
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}
13
16
14
- Usage: code-insiders.exe [options][paths...]
17
+ Usage: " ,
18
+ constants:: APPLICATION_NAME ,
19
+ " [options][paths...]
15
20
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
+ " -')
17
24
18
- {all-args}" ;
25
+ {all-args}"
26
+ ) ;
19
27
20
28
#[ derive( Parser , Debug , Default ) ]
21
29
#[ clap(
22
30
help_template = TEMPLATE ,
23
31
long_about = None ,
24
- name = "Visual Studio Code CLI" ,
32
+ name = CLI_NAME ,
25
33
version = match constants:: VSCODE_CLI_VERSION { Some ( v) => v, None => "dev" } ,
26
34
) ]
27
35
pub struct IntegratedCli {
@@ -53,7 +61,7 @@ pub struct CliCore {
53
61
#[ clap(
54
62
help_template = TEMPLATE ,
55
63
long_about = None ,
56
- name = "Visual Studio Code CLI" ,
64
+ name = CLI_NAME ,
57
65
version = match constants:: VSCODE_CLI_VERSION { Some ( v) => v, None => "dev" } ,
58
66
) ]
59
67
pub struct StandaloneCli {
@@ -115,7 +123,7 @@ impl<'a> From<&'a CliCore> for CodeServerArgs {
115
123
116
124
#[ derive( Subcommand , Debug , Clone ) ]
117
125
pub enum StandaloneCommands {
118
- /// Updates the VS Code CLI.
126
+ /// Updates the CLI.
119
127
Update ( StandaloneUpdateArgs ) ,
120
128
}
121
129
@@ -133,14 +141,14 @@ pub enum Commands {
133
141
/// Run `code tunnel --help` for more usage info.
134
142
Tunnel ( TunnelArgs ) ,
135
143
136
- /// Manage VS Code extensions.
144
+ /// Manage editor extensions.
137
145
#[ clap( name = "ext" ) ]
138
146
Extension ( ExtensionArgs ) ,
139
147
140
148
/// Print process usage and diagnostics information.
141
149
Status ,
142
150
143
- /// Changes the version of VS Code you're using.
151
+ /// Changes the version of the editor you're using.
144
152
Version ( VersionArgs ) ,
145
153
}
146
154
@@ -251,16 +259,16 @@ pub struct VersionArgs {
251
259
252
260
#[ derive( Subcommand , Debug , Clone ) ]
253
261
pub enum VersionSubcommand {
254
- /// Switches the instance of VS Code in use.
262
+ /// Switches the version of the editor in use.
255
263
Use ( UseVersionArgs ) ,
256
264
257
- /// Shows the currently configured VS Code version.
265
+ /// Shows the currently configured editor version.
258
266
Show ,
259
267
}
260
268
261
269
#[ derive( Args , Debug , Clone ) ]
262
270
pub 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",
264
272
/// a version number, or an absolute path to an existing install.
265
273
#[ clap( value_name = "stable | insiders | x.y.z | path" ) ]
266
274
pub name : String ,
@@ -346,19 +354,19 @@ impl EditorOptions {
346
354
}
347
355
}
348
356
349
- /// Arguments applicable whenever VS Code desktop is launched
357
+ /// Arguments applicable whenever the desktop editor is launched
350
358
#[ derive( Args , Debug , Default , Clone ) ]
351
359
pub struct DesktopCodeOptions {
352
360
/// Set the root path for extensions.
353
361
#[ clap( long, value_name = "dir" ) ]
354
362
pub extensions_dir : Option < String > ,
355
363
356
364
/// 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 .
358
366
#[ clap( long, value_name = "dir" ) ]
359
367
pub user_data_dir : Option < String > ,
360
368
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
362
370
/// can be persisted with `code version use <version>`. Can be "stable",
363
371
/// "insiders", a version number, or an absolute path to an existing install.
364
372
#[ clap( long, value_name = "stable | insiders | x.y.z | path" ) ]
@@ -386,7 +394,7 @@ impl DesktopCodeOptions {
386
394
387
395
#[ derive( Args , Debug , Default , Clone ) ]
388
396
pub struct GlobalOptions {
389
- /// Directory where CLI metadata, such as VS Code installations, should be stored.
397
+ /// Directory where CLI metadata should be stored.
390
398
#[ clap( long, env = "VSCODE_CLI_DATA_DIR" , global = true ) ]
391
399
pub cli_data_dir : Option < String > ,
392
400
@@ -464,7 +472,7 @@ pub struct EditorTroubleshooting {
464
472
#[ clap( long, value_name = "memory" ) ]
465
473
pub max_memory : Option < usize > ,
466
474
467
- /// Shows all telemetry events which VS code collects.
475
+ /// Shows all telemetry events which the editor collects.
468
476
#[ clap( long) ]
469
477
pub telemetry : bool ,
470
478
}
0 commit comments