Crate combu

Source
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 です)。

もう少し詳しく知りたい場合、まず初めにREADME(ファイルはこちら、Githubのページはこちら)をお読みください。

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にたどり着くまでの情報およびパース結果を格納する構造体。 フラグの値、たどってきたルートなどを保管しています。