Module args

Module args 

Source
Expand description

Command-line argument handling for Seq

Provides access to command-line arguments passed to the program.

§Usage from Seq

arg-count  # ( -- Int ) number of arguments (including program name)
0 arg      # ( Int -- String ) get argument at index

§Example

: main ( -- Int )
  arg-count 1 > if
    1 arg write_line  # Print first argument (after program name)
  else
    "No arguments provided" write_line
  then
  0
;

Re-exports§

pub use patch_seq_arg_at as arg_at;
pub use patch_seq_arg_count as arg_count;
pub use patch_seq_args_init as args_init;

Functions§

patch_seq_arg_at
Get command-line argument at index
patch_seq_arg_count
Get the number of command-line arguments
patch_seq_args_init
Initialize command-line arguments from C-style argc/argv