bpriver_chain 0.4.0 copy "bpriver_chain: ^0.4.0" to clipboard
bpriver_chain: ^0.4.0 copied to clipboard

Implementation of chain language. Available as cui, argument parser or inter-appliation communication.

Chain Language

Chain is serial data description language.

Use #

  • cui
  • argument parser
  • inter-application communication

Syntax #

For example, tiger 's cui is chain language.

tiger run --taskLocation 'abc' --taskName 'tiger_sample.yaml'

run is head.
--taskLocation 'abc' and --taskName 'tiger_sample.yaml' is option.
There is no example, -log is flag.

Chain contains only Head, Option, and Flag.

Name must be unique #

Head name, option name, and flag name must not be duplicate.

  1. head position is the beginning.
  2. head prefix is no hypen.
  3. head is not empty.
  4. head quantity is 0 or 1.
    • depending on your system, you may want to implement a default head.

Option #

  1. option position is free.
  2. option prefix is double-hypen.
  3. option is not empty.
  4. option quantity is 0 or more.
  5. option value quantity is 0 or more.
    • In the above example, 'abc' and 'tiger_sample.yaml' is option value.
  6. option value position is right behind option or right behind option value.
    • you can make a List by placing option value in a row.
    • example, --something 'a' 'b' 'c'
  7. option value prefix is no hypen.
  8. option value is available empty.
    • example, --something '' 'b' 'c'

Flag #

  1. flag position is free.
  2. flag prefix is single-hypen.
  3. flag is not empty.
  4. flag quantity is 0 or more.

Include white space #

if you want to include white space in serial source, Please circle it with single or double quotation.
example: --something 'hello world'

Include quotation #

if you want to include single quotation in serial source, Please circle it with double quotation.
example: --something "abc'def'ghi"
if you want to include double quotation in serial source, Please circle it with single quotation.
example: --something 'abc"def"ghi'

Other #

Triple-hypen or more prefix

Valid as head or option value.
But, Not recommended.

Pass value that starts with a hyphen to option value

Impossible.

There is no shorthand for head, option, and flag

There is only one way to specify.

Please depend on bpriver_origin library #

When extracting values ​​from the chain, we use the Result type.

dependencies:
  bpriver_origin: ^1.0.0

Result type is available.

import 'package:bpriver_origin/logger_result.dart';

Code #

The example code is in the example folder.

0
likes
0
points
309
downloads

Publisher

verified publisherbpriver.com

Weekly Downloads

Implementation of chain language. Available as cui, argument parser or inter-appliation communication.

Repository (GitLab)
View/report issues

License

unknown (license)

Dependencies

bpriver_origin, bpriver_syntax_scanner

More

Packages that depend on bpriver_chain