-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use optparse-applicative instead of cmdargs #111
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README.md에 CLI 예제가 있는데 그쪽도 업데이트해야 합니다.
nirum.cabal
Outdated
@@ -133,6 +134,7 @@ test-suite spec | |||
, megaparsec | |||
, mtl | |||
, nirum | |||
, optparse-applicative >=0.13.1 && <0.14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test-suite spec
쪽은 library
쪽 의존성 버전을 따라가면 되니까, 버전 명시 안해도 될 것 같습니다.
src/Nirum/Cli.hs
Outdated
optsParser = | ||
OPT.info | ||
(OPT.helper <*> versionOption <*> programOptions) | ||
(OPT.fullDesc <> OPT.progDesc "Nirum compiler." <> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
원래는 버전도 같이 표시했었는데 빠졌네요. 마침표는 없어도 될 것 같습니다.
src/Nirum/Cli.hs
Outdated
programOptions :: OPT.Parser Opts | ||
programOptions = | ||
Opts <$> OPT.strOption | ||
(OPT.long "outdir" <> OPT.short 'o' <> OPT.metavar "OUTDIR" <> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 metavar은 DIR
이면 될 것 같습니다. Long option name은 output-dir
정도로 푸는 게 나아 보입니다.
src/Nirum/Cli.hs
Outdated
OPT.help "out directory") <*> | ||
OPT.strOption | ||
(OPT.long "target" <> OPT.short 't' <> OPT.metavar "TARGET" <> | ||
OPT.help "Target name") <*> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
설명은 “target language name” 정도로 적어주세요.
src/Nirum/Cli.hs
Outdated
(OPT.long "target" <> OPT.short 't' <> OPT.metavar "TARGET" <> | ||
OPT.help "Target name") <*> | ||
OPT.strArgument | ||
(OPT.metavar "PACKAGE" <> OPT.help "Package directory") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
마찬가지로 metavar은 DIR
정도가 적당할 것 같습니다.
src/Nirum/Cli.hs
Outdated
, (&=) | ||
) | ||
import System.Console.CmdArgs.Default (def) | ||
import Data.Monoid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 모듈에서 어떤 거 가져다 쓰는 거예요? import qualified
로 하거나 필요한 것만 명시적으로 가져오는 게 좋을 듯하네요.
README.md
Outdated
-V --version Print version information | ||
--numeric-version Print just the version number | ||
Usage: nirum [-v|--version] (-o|--output-dir DIR) (-t|--target TARGET) DIR | ||
Nirum compiler0.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
버전 앞에 띄어쓰기 넣어주세요
README.md
Outdated
@@ -55,17 +55,17 @@ In order to compile a Nirum package (`examples/`) to a Python package: | |||
For more infomration, use `--help` option: | |||
|
|||
$ nirum --help | |||
Nirum Compiler 0.3.0 | |||
nirum - The IDL compiler and RPC/distributed object framework |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“Nirum”은 고유명사니까 대문자로 시작을…
Fix regressive things PR #111 missed
Use optparse-applicative which one is suggested in #88. this PR close #88 as well.