mirror of
https://github.com/cheat/cheat.git
synced 2025-09-04 19:18:29 +02:00
Resolved a merge conflict and made a minor commenting change.
This commit is contained in:
24
cheat
24
cheat
@ -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()])))
|
||||
|
Reference in New Issue
Block a user