Expand description
combu is a customizable cli framework crate. The library name “combu” comes from command + 昆布(konbu, it means kelp in japanese).
combu has no dependencies(or depends on only std library). Crate.io’s page is here.
To know more about this crate, please read README(You can read file OR Github) first.
combu(com + 昆布)は柔軟に CLI を組み上げられることを目標とした、カスタマイズ可能な CLI フレームワークです(一時クレートの名前が cmb だったこともありましたが、現在は combu です)。
Re-exports§
pub use action::Action;
pub use action::ActionError;
pub use action::ActionResult;
pub use action::ActionResult::Done;
pub use action::ActionResult::ParentActionRequest;
pub use command::Command;
pub use flag::Flag;
pub use flag::FlagType;
pub use flag::FlagValue;
pub use parser::Parser;
pub use vector::Vector;
Modules§
- action
- action is a module about Action
- command
- command is a module about command
- flag
- flag is a module about flag
- parser
- parser is a module about command args parser
- pub_
macros - Macros for combu export macros for combu combuのためのエクスポート用マクロ集
- vector
- vector is a moudle about vector
Macros§
- action
- Build helper for action
- action_
result - action_result type annotation
- alias
- Returns alias for Command Construction
- authors_
flag - Macro for preset authors flag.
- char
- Returns char from ident
- check
- Checks context macro.
- check_
authors - Checks context has authors flag. If the context has author flag, show authors and exit.
- check_
copyright - Checks context has license flag. If the context has license flag, show authors and exit.
- check_
error - Macro for parse error check
- check_
help - Checks context has help flag. If the context has help flag, return ShowHelpRequest.
- check_
license - Checks context has license flag. If the context has license flag, exec $license_func and return done.
- check_
preset_ flags - Checks context has values of the preset flags.
- check_
version - Checks context has version flag. If the context has help flag, show version and exit.
- checks
- List check macro
- cmd
- create cmd helper with full detail
- cmds
- alias of commands! macro
- commands
- create command array
- copyright
- Macro for creating copyright
- copyright_
flag - Macro for preset copyright flag.
- crate_
authors - Gets crate’s authors from cargo.toml.
- crate_
description - Gets crate’s description from cargo.toml.
- crate_
license - Gets license of crate from cargo.toml.
- crate_
license_ file - Gets license file path of crate from cargo.toml.
- crate_
name - Gets crate name from cargo.toml.
- crate_
version - Gets crate’s version from cargo.toml.
- def_
action_ func - Build helper for action
- default_
description - Default description for presets.
- default_
flag_ name - Default name for preset flags
- default_
flag_ short_ alias - Default alias for preset flags
- default_
flag_ value - Creates default_flag_value
- default_
name - Default name for presets
- default_
usage - Create usage
- default_
val - Default value for presets.
- default_
value - Default value for presets. (Alias)
- define_
help_ command_ action - Preset of definition of help command action
- define_
parent_ help_ request_ action - Preset for definition function that can use help request action
- done
- Simple Alias of Ok(Done)
- flag
- Helps for creating flag.
- flag_
type - Gets FlagType from keyword
- flag_
value - Creates flag_value
- flags
- Helps for creating flags.
- help_
command_ action - preset of help command action
- help_
flag - Macro for preset help flag.
- include_
license_ file - Gets license information from cargo.toml.
- license
- create license helper
- license_
flag - Macro for preset license flag.
- long_
alias - long_alias_expander
- no_flag
- Macro for preset no flag.
- option_
string_ from - option_string_from macro
- option_
wrap - Wrap with option if argument is not None.
- output_
help - Print preset help shortcut
- parent_
help_ request_ action - Preset for help request to parent command
- preset_
help_ command - Preset of help command
- preset_
root - Macro for preset root.
- result
- alias of Ok(ActionResult::Result(cmd, ctx))
- root_
from_ crate - Macro for convinience to create root command.
- short_
alias - short_alias_expander
- string_
fn - Creates function returns given string
- string_
from - string_from macro. based on Strong::from, but no arg can generate String::new()
- tt_
stringify - stringifier(not stringify about literal)
- type_
default_ value - get Default falue from type
- v
- Creates new Vector.
- vector
- Creates new Vector.
- version
- Macro for specification of command version
- version_
flag - Macro for preset version flag.
- yes_
flag - Macro for preset yes flag.
Structs§
- Context
- Storage information for command execution. This storage raw args, non-flag args, flag values, and etc. コマンドからrunを通ってactionにたどり着くまでの情報およびパース結果を格納する構造体。 フラグの値、たどってきたルートなどを保管しています。