Head command, plus fix for cat #49
+'use strict'; | ||
+ | ||
+var interfacer = require('./../util/interfacer'); | ||
+var fs = require('fs'); | ||
+var fsAutocomplete = require('vorpal-autocomplete-fs'); | ||
+ | ||
+var head = { | ||
+ exec: function exec(args, options) { | ||
+ var self = this; | ||
+ options = options || {}; | ||
+ | ||
+ options.argsType = args.stdin === undefined ? 'files' : 'stdin'; | ||
+ options.n = options.n === undefined ? 10 : options.n; | ||
+ | ||
+ if (options.n < 1) { | ||
+ self.log('Option n must be a positive integer.'); |
Linux Also,
I see your point here, but to be posix compliant we need to make sure it is a positive decimal integer. I'm not sure about the 0. Is 0 a positive decimal integer? I see your point. I think supporting negative options wouldn't necessarily be a bad move, but it seems like it's not necessary according to this standard. I believe 0 is not a positive integer. So it's up to you if you want to support it or not, just like with negative values
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
Okay,you guys are awesome!
Added you both as collaborators. Until you get a bit more familiar with the project, please ping me on changes you do. Feel free to make minor patches, obviously on anything breaking consult with me as well.
No description provided.