Index

lognestmonster / 26ca1d3

A general-purpose single-header C logging library and parser for event-based logs. (Incomplete)

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
7117 Aug 2019 20:3326ca1d3responses for help, version, no argsJosh Stockin1360N

Blob @ lognestmonster / parser / parseargs.py

application/x-python1214 bytesdownload raw
1# lognestmonster Copyright (c) 2019 Joshua 'joshuas3' Stockin
2# <https://github.com/JoshuaS3/lognestmonster/>.
3
4
5# This file is part of lognestmonster.
6
7# lognestmonster is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11
12# lognestmonster is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16
17# You should have received a copy of the GNU General Public License
18# along with lognestmonster. If not, see <https://www.gnu.org/licenses/>.
19
20from args import *
21# yeah, I know argparse is a thing, but I don't like it...
22
23def get_arg_from_indicator(indicator):
24 for option in ARGUMENT_OPTIONS:
25 if indicator in ARGUMENT_OPTIONS[option]["indicators"]:
26 return option
27 return None
28
29def get_arg_description(name):
30 return ARGUMENT_OPTIONS[name]["description"]
31
32def parseargs(argv):
33 options = {}
34 for arg in argv:
35 opt = get_arg_from_indicator(arg)
36 return options
37