Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msign should allow for friendlier expiry date formats #61

Closed
jclulow opened this issue Jun 18, 2013 · 10 comments
Closed

msign should allow for friendlier expiry date formats #61

jclulow opened this issue Jun 18, 2013 · 10 comments
Assignees

Comments

@jclulow
Copy link
Contributor

jclulow commented Jun 18, 2013

It would be neat if you could present expiry dates in some friendlier formats, e.g.

msign -E "2d"
msign -E "next wednesday"
msign -E "teatime"
@ghost ghost assigned jclulow Jun 18, 2013
@trentm
Copy link
Contributor

trentm commented Jun 18, 2013

while fun, I find the "next wednesday" etc. open ended format to be so loosy-goosy that it makes it harder. I don't want a game to specify a time. A strict "[m|d|y|h]" format is clear and would definitely be useful.

my 2 cents

@jclulow
Copy link
Contributor Author

jclulow commented Jun 18, 2013

Emotionally charged language aside, there's really no reason I can immediately see that I can't do both.

@trentm
Copy link
Contributor

trentm commented Jun 18, 2013

Sorry, if I came off as grumpy. I didn't mean to be emotional.

@jperkin
Copy link

jperkin commented Jun 18, 2013

FWIW I agree with trent, 'teatime' has always been wrong in Unix - 4pm is way too late and would interfere with dinner time, it should instead be 3pm. However, that way lies bikesheds.

@jclulow
Copy link
Contributor Author

jclulow commented Jun 19, 2013

I'm working on this:

image

@cobracmder
Copy link
Contributor

Definitely would like something more friendly (doesn't have to be natural language) but some standard time format like ISO.

2013-07-03T13:15:00.345Z
or
2013-184-13:15:00.345Z (if you want to use julian day instead of month and day of month)

@konobi
Copy link

konobi commented Aug 16, 2015

There's always shell foo that could be used...
$(gdate -d 'next tuesday')

bahamas10 added a commit that referenced this issue Sep 6, 2015
bahamas10 added a commit that referenced this issue Jan 19, 2016
bahamas10 added a commit that referenced this issue Jan 20, 2016
@jussisallinen
Copy link

Could these changes be merged eventually?

@bahamas10
Copy link
Contributor

https://cr.joyent.us/#/c/4707/

$ ./node_modules/.bin/nodeunit test/msign.test.js 

msign.test.js
✔ msign (no arguments)
✔ msign ~~/stor/foo
✔ msign -e <expires> ~~/stor/foo
✔ msign -E 1h ~~/stor/foo
✔ msign -E 1s ~~/stor/foo (good argument)
✔ msign -E 1m ~~/stor/foo (good argument)
✔ msign -E 1h ~~/stor/foo (good argument)
✔ msign -E 1d ~~/stor/foo (good argument)
✔ msign -E 1w ~~/stor/foo (good argument)
✔ msign -E 1y ~~/stor/foo (good argument)
✔ msign -E foo ~~/stor/foo (bad argument)
✔ msign -E and -e together

OK: 26 assertions (7105ms)

joyent-automation pushed a commit that referenced this issue Aug 24, 2018
Reviewed by: Robert Mustacchi <[email protected]>
Reviewed by: Trent Mick <[email protected]>
Approved by: Trent Mick <[email protected]>
@bahamas10
Copy link
Contributor

available in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants