more mass renaming
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
|
||||
|
||||
%%=====================================================
|
||||
%% ARG PARSING
|
||||
%%=====================================================
|
||||
|
||||
|
||||
%%-----------------------------------------------------
|
||||
%% TOKENIZING
|
||||
%%-----------------------------------------------------
|
||||
|
||||
-record{ctk,
|
||||
{shape = none :: none | '-' | '--' | str,
|
||||
val = none :: none | [char()] | string() | string(),
|
||||
str = none :: none | string()}).
|
||||
-type ctk() :: #ctk{}.
|
||||
|
||||
|
||||
|
||||
-spec tokenize(Args) -> CliTokens when
|
||||
Args :: [string()],
|
||||
CliTokens :: [ctk()].
|
||||
%% @private tokenize cli args
|
||||
|
||||
tokenize(Args) ->
|
||||
[tokenize_arg(S) || S <- Args].
|
||||
|
||||
tokenize_arg(Str = "--" ++ Val) ->
|
||||
#ctk{shape = '--',
|
||||
val = Val,
|
||||
str = Str};
|
||||
tokenize_arg(Str = "-" ++ Val) ->
|
||||
#ctk{shape = '-',
|
||||
val = Val,
|
||||
str = Str};
|
||||
tokenize_arg(Str) ->
|
||||
#ctk{shape = str,
|
||||
val = none,
|
||||
str = Str}.
|
||||
|
||||
|
||||
%%-----------------------------------------------------
|
||||
%% PARSING
|
||||
%%-----------------------------------------------------
|
||||
Reference in New Issue
Block a user