diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2021-05-18 23:24:40 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2021-05-18 23:24:40 -0600 |
commit | 53c362e98febfccd193b27ccaf5c1e74e298d1ae (patch) | |
tree | 95b027774dfb433c5ad1a3f0fccae3b377c13ada /src | |
parent | efd7859719411e085cb7bce6203c9ee15b3b81de (diff) |
finally fix argparse error, questionmark
Diffstat (limited to 'src')
-rw-r--r-- | src/pyssg/configuration.py | 6 | ||||
-rw-r--r-- | src/pyssg/pyssg.py | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/pyssg/configuration.py b/src/pyssg/configuration.py index e440c37..ec9f62b 100644 --- a/src/pyssg/configuration.py +++ b/src/pyssg/configuration.py @@ -79,13 +79,13 @@ class Configuration: self.base_url = opts['url'] if self.dformat is None: - self.dformat = opts['date-format'] + self.dformat = opts['date_format'] if self.l_dformat is None: - self.l_dformat = opts['list-date-format'] + self.l_dformat = opts['list_date_format'] if self.lsep_dformat is None: - self.lsep_dformat = opts['list-sep-date-format'] + self.lsep_dformat = opts['list_sep_date_format'] if self.force is None: self.force = opts['force'] diff --git a/src/pyssg/pyssg.py b/src/pyssg/pyssg.py index f90cfcb..40c602b 100644 --- a/src/pyssg/pyssg.py +++ b/src/pyssg/pyssg.py @@ -39,19 +39,19 @@ def get_options() -> Namespace: default='%a, %b %d, %Y @ %H:%M %Z', type=str, help='''date format used inside pages (for creation and - modification times, for example); defaults to '%a, %b - %d, %Y @ %H:%M %Z' ('Tue, Mar 16, 2021 @ 02:46 UTC', + modification times, for example); defaults to '%%a, %%b + %%d, %%Y @ %%H:%%M %%Z' ('Tue, Mar 16, 2021 @ 02:46 UTC', for example)''') parser.add_argument('--list-date-format', default='%b %d', type=str, help='''date format used for page entries in a list; - defaults to '%b %d' ('Mar 16', for example)''') + defaults to '%%b %%d' ('Mar 16', for example)''') parser.add_argument('--list-sep-date-format', default='%B %Y', type=str, help='''date format used for the separator between page - entries in a list; defaults to '%B %Y' ('March 2021', + entries in a list; defaults to '%%B %%Y' ('March 2021', for example)''') parser.add_argument('-i', '--init', action='store_true', @@ -71,9 +71,6 @@ def get_options() -> Namespace: def main() -> None: opts: dict[str, Union[str, bool]] = vars(get_options()) - for k, v in opts.items(): - print(k, v) - conf_path: str = opts['config'] conf_path = os.path.expandvars(conf_path) |