#ruby - 05 July 2019
« Back 1 day Forward 1 day »
[09:06:54] balo: NL3limin4t0r: happy 5th of July. there is no reason why not celebrating any specific day :D
[09:14:44] Joufflu: I mean I went to the docs and read it a few times but its not really hitting home
[12:12:57] TvL2386: hi all, I'm looking for a good solution to implement cli parsing. Kind of like how `gem ...` works
[12:15:30] TvL2386: ytti: how would you implement something that would have different options for sub actions? Like 'gem install ...' 'gem source ...'
[12:15:51] TvL2386: I'm trying to think of something cool and trying to select the appropriate tool for that
[12:16:39] TvL2386: I am especially looking for something that can create a great --help page based on all options/paths that can be taken
[12:17:22] ytti: i've not had the same demand so i can't recommend one for subcommands, i'm sure you are still spoiled for choice
[12:19:40] ytti: TvL2386, did you check cri, it seems to specifically mention subcommands and latest commit is under month old
[13:31:40] leitz: TvL2386, I enjoy books, so https://www.amazon.com/Build-Awesome-Command-Line-Applications-Ruby/dp/1934356913
[14:22:13] TvL2386: I am still trying to find out what the difference is between `required` and `optional`, since it works exactly the same... it does not fail when a required argument is missing
[14:25:37] NL3limin4t0r: https://github.com/ddfreyne/cri#forbidden-required-and-optional-arguments-argument
[14:26:15] NL3limin4t0r: > :required means that the option must be followed by an argument, which will then be treated as the value for the option. It does not mean that the option itself is required.
[14:27:14] NL3limin4t0r: > :optional means that the option can be followed by an argument. If it is, then the argument is treated as the value for the option; if it isn’t, the value for the option will be true.
[14:33:38] TvL2386: so... I should implement that myself it seems... Would be cool if I could do something like `opts.validate!` which would print a stderr page listing the problems and exit(1)
[14:40:02] NL3limin4t0r: TvL2386: btw, looking at the thor documentation they do allow you to make an option required. http://whatisthor.com/#options-and-flags
[14:43:50] NL3limin4t0r: Maybe cri also offers it somewhere, but I can't easily find it in the documentation.
[14:51:13] TvL2386: NL3limin4t0r: it's really great though... I love this default help page it can generate, also the subcommands work really smooth. They also have autogenerated help pages
[18:02:08] green-: trying to sort a runtime error with gem/compass … but not really sure where to start and google has been of limited to no help. any thoughts would be appreciated: https://pastebin.com/z23nVCJT
[18:02:09] ruby[bot]: green-: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[18:03:17] green-: well, even though the bot doesn’t like pastebin … gist.github requires an account to post snippets, no?
[18:04:58] green-: yeah was just trying to avoid signing up for an acct to make a paste … this runtime error already has me squandering enough productive time :)
[18:20:16] green-: now i’m not even getting any of that runtime error trace … just “error while loading shared libraries: libruby.so.2.3: cannot open shared object file: No such file or directory”
[18:24:34] green-: seems to originate from ffi, but everything involved seems to be up to date (ffi, rb-inotify, compass, etc) … so I don’t have a clue as to what the issue could be