Utilities

Arguments

Flag Exists

- <proc[drustcraftp.util.args.flag_exists].context[<args>|<flag>]>

Searches the <args> list for the <flag> letter and returns the list index if it exists. If the flag is not found, the procedure will return 0.

Note that the list index may contain other flags if the command was run combining multiple flags (ie: /mycommand -abcd).

Flags Clear

- <proc[drustcraftp.util.args.flags_clear].context[<args>]>

Remove all flag items from the <args> list. Note that if a flag has a trailing option, the trailing option is not removed. Instead, it may have to be removed manually:

- define args:<context.args>
- define name_flag:<proc[drustcraftp.util.args.flag_exists].context[<[args]>|n]>
- if <[name_flag]> != 0:
- define name_flag:<[args].get[<[name_flag].add[1]>]>
- define args:<[args].remove[<[name_flag]>|<[name_flag].add[1]>]>