Jump to content




[Snippet] Argument Parser


3 replies to this topic

#1 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 24 February 2019 - 09:03 PM

This code snippet will allow your programs to interpret arguments much like a Linux command would!

https://raw.githubus...r/argparser.lua

Using this, your program can have arguments like:
program.lua -s -c 2 -b Spaghet mamamia ravioli

Example (in progdor2):
Spoiler

Edited by LDDestroier, 24 February 2019 - 09:03 PM.


#2 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 25 February 2019 - 03:33 PM

Looks like my getopts program (which needs redone), but inline and easier to use.

#3 LDDestroier

  • Members
  • 1,095 posts
  • LocationACDC Town

Posted 25 February 2019 - 04:13 PM

View PostEveryOS, on 25 February 2019 - 03:33 PM, said:

Looks like my getopts program (which needs redone), but inline and easier to use.

Oh hey, I was actually looking for that before I made this. But I forgot the name, and figured it'd be good practice to make a parser myself.

#4 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 26 February 2019 - 03:41 PM

Yeah, when I get to it I plan to make one more update to it - on a separate paste, of course - but I would like to make it easier to use and more flexible.

Oh, and thanks

Edited by EveryOS, 26 February 2019 - 03:42 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users