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

OSX Compatibility: replace getopt with argbash #2

Open
tchia04 opened this issue Dec 2, 2016 · 2 comments
Open

OSX Compatibility: replace getopt with argbash #2

tchia04 opened this issue Dec 2, 2016 · 2 comments

Comments

@tchia04
Copy link

tchia04 commented Dec 2, 2016

 
$ inodes
------------------------------------------
[CONFIG] Arguments not used, directory specified as hd:t:e:
------------------------------------------
	INODE USAGE SUMMARY
------------------------------------------
    INODES |       SIZE | DIRECTORY
------------------------------------------
find: hd:t:e:: No such file or directory
------------------------------------------
find: hd:t:e:: No such file or directory
du: hd:t:e:: No such file or directory
       0   |            | hd:t:e:
------------------------------------------
$
tonychia@Tonys-MacBook-Pro ~ $ inodes -d `pwd`
------------------------------------------
[CONFIG] Arguments not used, directory specified as hd:t:e:
------------------------------------------
	INODE USAGE SUMMARY
------------------------------------------
    INODES |       SIZE | DIRECTORY
------------------------------------------
find: hd:t:e:: No such file or directory
------------------------------------------
find: hd:t:e:: No such file or directory
du: hd:t:e:: No such file or directory
       0   |            | hd:t:e:
------------------------------------------
tonychia@Tonys-MacBook-Pro ~ $
@tripflex
Copy link
Owner

tripflex commented Dec 28, 2016

Looks like it's due to using OSX, which I drilled down to getopt requiring GNU based version (for format).

Should be easy to fix, i'll probably end up switching to this argbash:
https://argbash.io/
http://argbash.readthedocs.io/en/stable/usage.html#argbash

  • create argbash template file
  • verify -d and positional argument work correctly (for backwards compatibility)
  • replace existing getopt for argbash code
# ARG_OPTIONAL_SINGLE([dir],[d],[Directory to scan and count inodes (overrides positional arg dir2)],[`pwd`])
# ARG_OPTIONAL_SINGLE([tree],[t],[Show tree for directories with inodes above this number],[])
# ARG_OPTIONAL_SINGLE([exclude],[e],[Exclude directory from report when below this many inodes],[])
# ARG_VERSION([echo test v$version])
# ARG_POSITIONAL_SINGLE([dir2],[Directory to scan and count inodes],[`pwd`])
# ARG_HELP([inodes - Count the amount of inodes in a given directory])
# ARGBASH_GO()

@tripflex tripflex changed the title inodes is not working OSX Compatibility: replace getopt with argbash Dec 28, 2016
@him229
Copy link

him229 commented Mar 10, 2017

Any update on this @tripflex or any other way to make this work @tchia04?

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

3 participants