diff --git a/cheat b/cheat index 6d1bddc..8d27c2d 100755 --- a/cheat +++ b/cheat @@ -1,6 +1,25 @@ #!/usr/bin/env python +""" +cheat.py -- Quick, abridged man pages with examples (main routines) + Copyright (C) 2013, Chris Lane + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +""" + import os import sys +import argparse import subprocess DEFAULT_CHEAT_DIR = os.environ.get('DEFAULT_CHEAT_DIR') or \ @@ -123,8 +142,8 @@ def main(): # create/edit option option = sys.argv[1].lower() if option in ['-e', '--edit', '-c', '--create']: - # make sure EDITOR environment variable is set and that at least 3 arguments - # are given + # make sure EDITOR env variable is set and that at least + # 3 arguments are given if 'EDITOR' not in os.environ: print('In order to use "create" or "edit" you must set your ' 'EDITOR environment variable to your favorite editor\'s path')