diff options
Diffstat (limited to 'pnote')
| -rw-r--r-- | pnote/__init__.py | 2 | ||||
| -rw-r--r-- | pnote/__main__.py | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/pnote/__init__.py b/pnote/__init__.py index e4dd2d5..7f44083 100644 --- a/pnote/__init__.py +++ b/pnote/__init__.py @@ -1,3 +1,3 @@ -__version__ = "0.0.26" +__version__ = "0.0.27" from pnote.__main__ import main diff --git a/pnote/__main__.py b/pnote/__main__.py index d652ddd..c5c2ede 100644 --- a/pnote/__main__.py +++ b/pnote/__main__.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import os, argparse +from pathlib import Path from pnote.project import * from pnote.tools import * from pnote import __version__ @@ -11,9 +12,9 @@ def main(): prog='PNote', description='Note management tool', epilog='pnote v'+__version__) - parser.add_argument('path', help="Path to a pnote project") parser.add_argument('-t', '--today', help="Open today's note file", action="store_true") parser.add_argument('-o', '--open', help="Open specific note file") + parser.add_argument('-d', '--dir', help="Project directory") subparsers = parser.add_subparsers(dest="tool", help='Tool to use') # Tools @@ -30,7 +31,12 @@ def main(): args = parser.parse_args() ## Load project - project=Project(args.path) + if args.dir: + project=Project(args.dir) + else: + pdir=Path.home()/".pnote/" + pdir.mkdir(parents=True, exist_ok=True) + project=Project(pdir) ## Run tool if args.tool == "search": |
