summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/pyssg/configuration.py6
-rw-r--r--src/pyssg/pyssg.py11
3 files changed, 8 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index a10963f..9cd3887 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
CHANGES
=======
+* checking argparse errors
* fix missing import
v0.2.3
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)