On this page:
current_  program
current_  command_  line
current_  flag_  string
current_  containing_  flag_  string
String.to_  lib_  module_  path
8.16.0.2
14.6.2 Command Line Parser Parameters and Annotations🔗ℹ

context parameter

Parameter.def cmdline.current_program

  :: String || Path

 

context parameter

Parameter.def cmdline.current_command_line

  :: List.of(String)

 

context parameter

Parameter.def cmdline.current_flag_string

  :: maybe(String)

 

context parameter

Parameter.def cmdline.current_containing_flag_string

  :: maybe(String)

Parameters used for command-line parsing.

The cmdline.current_program and cmdline.current_command_line parameters provide defaults to start parsing, but they are also set by Parser.parse to match supplied arguments in case they are different than the defaults.

The cmdline.current_flag_string and cmdline.current_containing_flag_string parameters are set when a flag handler is called to report the flag as written by the user. When the value of cmdline.current_flag_string is a short-form flag like "-h", then cmdline.current_containing_flag_string may be set to a combination flag like "-vh" to report more precisely how it was written by the user.

annotation

cmdline.String.to_lib_module_path

A converter annotation that recognizes strings that are suitable for a lib module-path form. Unlike a string used directly with lib, the string is allowed to contain ! separating non-empty submodule names, and the result ModulePath rotates the submodule selections to outside the lib part.

This annotation is particularly intended for use with cmdline.flag and cmdline.args.

> def mp :: cmdline.String.to_lib_module_path = "rhombus/pict!private"

> mp

ModulePath('lib ("rhombus/pict.rhm") ! private')