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

Enhancement request: list of languages #2

Closed
kseistrup opened this issue Feb 24, 2013 · 6 comments
Closed

Enhancement request: list of languages #2

kseistrup opened this issue Feb 24, 2013 · 6 comments

Comments

@kseistrup
Copy link

It would be pretty useful if gitinit had a “-L, --list” switch that listed all recognized languages. Of course I program in a limited set of languages and I will soon know which of those gitinit recognizes. For a new gitinit user, however, a list switch would be helpful.

Cheers (and thanks for a useful program).

@iambibhas
Copy link
Owner

Try -

$ sudo pip install --upgrade gitinit
$ gitinit -L

@kseistrup
Copy link
Author

Cool, thanks for being so responsive.

Further enhancement: Alphabetizing the languages and putting one language per output line makes it so much easier to find your favourite language. :)

@kseistrup
Copy link
Author

I'm aware you've closed the issue, but here's a suggestion:

diff --git a/gitinit/gitinit.py b/gitinit/gitinit.py
index 5acae5f..0747f8f 100755
--- a/gitinit/gitinit.py
+++ b/gitinit/gitinit.py
@@ -118,12 +118,9 @@ def main():

     if args.list:
         print "List of languages supported right now:"
-        l = []
         gi_list = manager.all_gitignores()
-        for gi in gi_list:
-            if gi:
-                l.append(gi.split('/')[-1].split('.')[0])
-        print ', '.join(l)
+        l = [gi.split('/')[-1].split('.')[0].lower() for gi in gi_list if gi]
+        print ', '.join(sorted(l))
         return

     language = args.language or 'generic'
diff --git a/setup.py b/setup.py
index 8590ef6..d643615 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ __readme__ = os.path.join(__currdir__, 'README')

 setup(
     name="gitinit",
-    version="1.0.6",
+    version="1.0.6.2",
     author="Bibhas C Debnath",
     author_email="me@bibhas.in",
     description=("Initiates git with gitignore for provided language"),

:)

@iambibhas
Copy link
Owner

You know, I just came back home and on the road I was thinking about this particular piece of code. :D Will do this and check. :)

@iambibhas
Copy link
Owner

Install the dev version from git and check the -L output.

@kseistrup
Copy link
Author

/me likes :)

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

No branches or pull requests

2 participants