LoginSignup
0
0

More than 5 years have passed since last update.

AppleScriptでArgumentParserを書いてみた

Posted at

これは何?

AppleScriptで動くArgumentParser。
--key value --key2 value2みたいな引数リストを渡すと連想配列にparseして返してくれる。

なぜ書いたか

ターミナルから引数付きでスクリプトを呼ぶときに、引数の順番に関係なく動いてほしかった。

できること

  • longName指定
    --hoge fuga => {hoge:"fuga"}
  • shortName指定
    setShortNames({i:"ignore"}) then -i piyo => {ignore:"piyo"}
  • デフォルト値設定
    setDefaultValues({host:"127.0.0.1"})
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0