onetime-up 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/onetime/cli/parser.rb +32 -0
- data/lib/onetime/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 85848ba4ad61c6310845ccdd2df6c048888e971c849fc1d6d640d3a3ce1a11ef
|
|
4
|
+
data.tar.gz: 5c9ca274b07530486ec9afdbba6eaf47afba1e69a2078b4f0bd79f4c06cea641
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: da72a3d7b4673ec16948faf234370d1832d2eeb2cac2a80b77745e51feac89f1d72ee07d61e8f0888dfe4d8087d9efa07502402b887a76b9b15e8e023acea970
|
|
7
|
+
data.tar.gz: 9099fae30afbed57be879850097ec19641e850a40ebf51e3fab75083ef14de5a7820407fc6da345168de406566374271c08e506e7c174f3aef4beae2dfea4bef
|
data/lib/onetime/cli/parser.rb
CHANGED
|
@@ -78,6 +78,24 @@ module Onetime
|
|
|
78
78
|
|
|
79
79
|
def global_option_parser
|
|
80
80
|
OptionParser.new do |opts|
|
|
81
|
+
opts.banner = 'Usage: onetime [options] [command] [command options] [arguments]'
|
|
82
|
+
opts.separator ''
|
|
83
|
+
opts.separator 'Commands:'
|
|
84
|
+
opts.separator ' share [FILE ...] Share files or stdin (default command)'
|
|
85
|
+
opts.separator ' generate Generate a random secret'
|
|
86
|
+
opts.separator ' secret KEY|URL Retrieve a secret (alias: get)'
|
|
87
|
+
opts.separator ' receipt KEY Retrieve receipt metadata'
|
|
88
|
+
opts.separator ' status Show service status'
|
|
89
|
+
opts.separator ''
|
|
90
|
+
opts.separator 'Use onetime COMMAND --help for command options.'
|
|
91
|
+
opts.separator ''
|
|
92
|
+
opts.separator 'Examples:'
|
|
93
|
+
opts.separator ' onetime share message.txt'
|
|
94
|
+
opts.separator ' echo "a secret" | onetime share'
|
|
95
|
+
opts.separator ' onetime generate -t 3600'
|
|
96
|
+
opts.separator ' onetime secret https://eu.onetimesecret.com/secret/KEY'
|
|
97
|
+
opts.separator ''
|
|
98
|
+
opts.separator 'Global options:'
|
|
81
99
|
opts.on('-H BASE_URI', String) { |v| @base_uri = v }
|
|
82
100
|
opts.on('-c CUSTID', '--custid CUSTID', String) { |v| @custid = v }
|
|
83
101
|
opts.on('-k APIKEY', '--apikey APIKEY', String) { |v| @apikey = v }
|
|
@@ -88,12 +106,25 @@ module Onetime
|
|
|
88
106
|
opts.on('-s', '--string') { @string_flag = true }
|
|
89
107
|
opts.on('-D', '--debug') { @debug = true }
|
|
90
108
|
opts.on('-V', '--version') { @show_version = true }
|
|
109
|
+
opts.on('-h', '--help', 'Show this help') { puts opts; exit }
|
|
91
110
|
end
|
|
92
111
|
end
|
|
93
112
|
|
|
94
113
|
def command_option_parser(command)
|
|
95
114
|
allowed = COMMAND_OPTIONS.fetch(command, [])
|
|
96
115
|
OptionParser.new do |opts|
|
|
116
|
+
arguments = case command
|
|
117
|
+
when 'share' then ' [FILE ...]'
|
|
118
|
+
when 'secret' then ' KEY|URL'
|
|
119
|
+
when 'receipt' then ' KEY'
|
|
120
|
+
else ''
|
|
121
|
+
end
|
|
122
|
+
opts.banner = "Usage: onetime [global options] #{command} [options]#{arguments}"
|
|
123
|
+
if command == 'share'
|
|
124
|
+
opts.separator 'Reads stdin when no file is given; use - as a filename to read stdin.'
|
|
125
|
+
end
|
|
126
|
+
opts.separator ''
|
|
127
|
+
opts.separator 'Options:'
|
|
97
128
|
if allowed.include?(:ttl)
|
|
98
129
|
opts.on('-t TTL', '--ttl TTL', Integer) { |v| @ttl = v }
|
|
99
130
|
end
|
|
@@ -103,6 +134,7 @@ module Onetime
|
|
|
103
134
|
if allowed.include?(:recipient)
|
|
104
135
|
opts.on('-r RECIPIENT', '--recipient RECIPIENT', Array) { |v| @command_recipients.concat(Array(v)) }
|
|
105
136
|
end
|
|
137
|
+
opts.on('-h', '--help', 'Show this help') { puts opts; exit }
|
|
106
138
|
end
|
|
107
139
|
end
|
|
108
140
|
|
data/lib/onetime/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: onetime-up
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Delano Mandelbaum
|
|
8
8
|
- Saverio Miroddi
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|