Skip to content

Commit

Permalink
refactor: split each commands on parts
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsik-sus committed Nov 2, 2023
1 parent 601f458 commit 64e56fe
Show file tree
Hide file tree
Showing 3 changed files with 408 additions and 316 deletions.
92 changes: 46 additions & 46 deletions module/move/willbe/src/willbe/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,49 @@ pub( crate ) mod private

pub fn grammar_form() -> Vec< wca::Command >
{
// let publish_no_subj_command = wca::Command::former()
// .hint( "Publish package on `crates.io`." )
// .long_hint( "Publish package on `crates.io`." )
// .phrase( "publish" )
// .property( "dry", "Run command dry. Default is false.", Type::String, true )
// .property( "verbosity", "Setup level of verbosity.", Type::String, true )
// .property_alias( "verbosity", "v" )
// .form();
//
// let publish_command = wca::Command::former()
// .hint( "Publish package on `crates.io`." )
// .long_hint( "Publish package on `crates.io`." )
// .phrase( "publish" )
// .subject( "A path to package. Should be a directory with file `Cargo.toml`.", Type::List( Type::String.into(), ',' ), true )
// .property( "dry", "Run command dry. Default is false.", Type::String, true )
// .property( "verbosity", "Setup level of verbosity.", Type::String, true )
// .property_alias( "verbosity", "v" )
// .form();
//
// let workspace_publish_no_subj_command = wca::Command::former()
// .hint( "Publish packages from workspace on `crates.io`." )
// .long_hint( "Publish packages from workspace on `crates.io`." )
// .phrase( "workspace.publish" )
// .property( "dry", "Run command dry. Default is false.", Type::String, true )
// .property( "verbosity", "Setup level of verbosity.", Type::String, true )
// .property_alias( "verbosity", "v" )
// .form();
//
// let workspace_publish_command = wca::Command::former()
// .hint( "Publish packages from workspace on `crates.io`." )
// .long_hint( "Publish packages from workspace on `crates.io`." )
// .phrase( "workspace.publish" )
// .subject( "A path to manifest path with workspace. Should be a directory with file `Cargo.toml`.", Type::String, true )
// .property( "dry", "Run command dry. Default is false.", Type::String, true )
// .property( "verbosity", "Setup level of verbosity.", Type::String, true )
// .property_alias( "verbosity", "v" )
// .form();
//
// let list_no_subj_command = wca::Command::former()
// .hint( "List packages." )
// .long_hint( "List packages" )
// .phrase( "list" )
// .form();
let publish_no_subj_command = wca::Command::former()
.hint( "Publish package on `crates.io`." )
.long_hint( "Publish package on `crates.io`." )
.phrase( "publish" )
.property( "dry", "Run command dry. Default is false.", Type::String, true )
.property( "verbosity", "Setup level of verbosity.", Type::String, true )
.property_alias( "verbosity", "v" )
.form();

let publish_command = wca::Command::former()
.hint( "Publish package on `crates.io`." )
.long_hint( "Publish package on `crates.io`." )
.phrase( "publish" )
.subject( "A path to package. Should be a directory with file `Cargo.toml`.", Type::List( Type::String.into(), ',' ), true )
.property( "dry", "Run command dry. Default is false.", Type::String, true )
.property( "verbosity", "Setup level of verbosity.", Type::String, true )
.property_alias( "verbosity", "v" )
.form();

let workspace_publish_no_subj_command = wca::Command::former()
.hint( "Publish packages from workspace on `crates.io`." )
.long_hint( "Publish packages from workspace on `crates.io`." )
.phrase( "workspace.publish" )
.property( "dry", "Run command dry. Default is false.", Type::String, true )
.property( "verbosity", "Setup level of verbosity.", Type::String, true )
.property_alias( "verbosity", "v" )
.form();

let workspace_publish_command = wca::Command::former()
.hint( "Publish packages from workspace on `crates.io`." )
.long_hint( "Publish packages from workspace on `crates.io`." )
.phrase( "workspace.publish" )
.subject( "A path to manifest path with workspace. Should be a directory with file `Cargo.toml`.", Type::String, true )
.property( "dry", "Run command dry. Default is false.", Type::String, true )
.property( "verbosity", "Setup level of verbosity.", Type::String, true )
.property_alias( "verbosity", "v" )
.form();

let list_no_subj_command = wca::Command::former()
.hint( "List packages." )
.long_hint( "List packages" )
.phrase( "list" )
.form();

let list_command = wca::Command::former()
.hint( "List packages." )
Expand Down Expand Up @@ -81,9 +81,9 @@ pub( crate ) mod private

vec!
[
// publish_no_subj_command, publish_command,
// workspace_publish_no_subj_command, workspace_publish_command,
/* list_no_subj_command, */ list_command,
publish_no_subj_command, publish_command,
workspace_publish_no_subj_command, workspace_publish_command,
list_no_subj_command, list_command,
workspace_list_no_subj_command, workspace_list_command,
]
}
Expand Down
Loading

0 comments on commit 64e56fe

Please sign in to comment.