mirror of
https://github.com/cheat/cheat.git
synced 2024-12-22 04:35:06 +01:00
Initial commit.
This commit is contained in:
commit
2a178b53f9
38
cheat1
Normal file
38
cheat1
Normal file
@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# look up the first argument passed to the script
|
||||
cheat = case ARGV[0]
|
||||
when 'git'
|
||||
'
|
||||
Need notes on how to:
|
||||
1) Set colors
|
||||
2) Set name / email
|
||||
3) View/set remote branches
|
||||
'
|
||||
|
||||
when 'tar'
|
||||
'
|
||||
tar
|
||||
|
||||
To extract an uncompressed archive:
|
||||
tar -xvf /path/to/foo.tar
|
||||
|
||||
To extract a compressed archive:
|
||||
tar -xzvf /path/to/foo.tgz
|
||||
|
||||
To create a compressed archive:
|
||||
tar -czvf /path/to/foo.tgz /path/to/foo/
|
||||
|
||||
'
|
||||
|
||||
else
|
||||
'No cheat sheet available.'
|
||||
|
||||
end
|
||||
|
||||
|
||||
# find
|
||||
|
||||
# output
|
||||
puts cheat
|
||||
|
24
cheat2
Executable file
24
cheat2
Executable file
@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# Create a hash of cheatsheets
|
||||
cheats = {
|
||||
'tar' => '
|
||||
some long string
|
||||
some long string
|
||||
some long string
|
||||
some long string
|
||||
some long string
|
||||
some long string
|
||||
',
|
||||
|
||||
'git' => '
|
||||
some long string about git
|
||||
some long string about git
|
||||
some long string about git
|
||||
some long string about git
|
||||
some long string about git
|
||||
',
|
||||
}
|
||||
|
||||
# output
|
||||
puts cheats[ARGV[0]] || 'No cheat sheet found.'
|
Loading…
Reference in New Issue
Block a user