Resolved a merge conflict and made a minor commenting change.

This commit is contained in:
Chris Lane
2013-09-14 10:13:54 -04:00
19 changed files with 354 additions and 9 deletions

24
cheat
View File

@ -1,6 +1,29 @@
#!/usr/bin/env python
"""
cheat.py -- cheat allows you to create and view interactive cheatsheets on the
command-line. It was designed to help remind *nix system
administrators of options for commands that they use frequently,
but not frequently enough to remember.
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 <http://www.gnu.org/licenses/>.
"""
import os
import sys
import argparse
import subprocess
from textwrap import dedent
@ -112,6 +135,7 @@ def help(cheatsheets):
def list_cheatsheets(cheatsheets):
"Lists the cheatsheets that are currently available"
max_command = max([len(x) for x in cheatsheets.keys()]) + 3
return ('\n'.join(sorted(['%s [%s]' % (key.ljust(max_command), value)
for key, value in cheatsheets.items()])))