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 to switch off command long_desc wrap formatter. #100

Closed
bdiz opened this issue Jul 8, 2012 · 7 comments
Closed

Enhancement request to switch off command long_desc wrap formatter. #100

bdiz opened this issue Jul 8, 2012 · 7 comments

Comments

@bdiz
Copy link

bdiz commented Jul 8, 2012

I've got my own text wrap algorithm based on stty size. But then description gets re-wrapped.

@davetron5000
Copy link
Owner

Is the wrap not working? It should use the COLUMNS environment variable, or stty size if that is not available. What shell are you using?

@bdiz
Copy link
Author

bdiz commented Jul 9, 2012

It appeared, just from resizing/re-running, that the wrapping algorithm is fixed. I'm using 2.0.0.rc2 with tcsh. There is no $COLUMNS but stty size works.

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:16 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc wrap formatter. (#100)

Is the wrap not working? It should use the COLUMNS environment variable, or stty size if that is not available. What shell are you using?


Reply to this email directly or view it on GitHub:
#100 (comment)

@davetron5000
Copy link
Owner

Cool. I cribbed the algorithm from another project, but it's intended to
work in most reasonable shells (which includes tcsh :).

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog
Fork me on Github: http://davetron5000.github.com

On Mon, Jul 9, 2012 at 10:55 AM, bdiz <
reply@reply.github.com

wrote:

It appeared, just from resizing/re-running, that the wrapping algorithm is
fixed. I'm using 2.0.0.rc2 with tcsh. There is no $COLUMNS but stty size
works.

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:16 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Is the wrap not working? It should use the COLUMNS environment
variable, or stty size if that is not available. What shell are you
using?


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)

@bdiz
Copy link
Author

bdiz commented Jul 9, 2012

I'm sorry. By "fixed" I meant "width is unchanging". :)

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:58 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc wrap formatter. (#100)

Cool. I cribbed the algorithm from another project, but it's intended to work in most reasonable shells (which includes tcsh :).

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog Fork me on Github: http://davetron5000.github.com

On Mon, Jul 9, 2012 at 10:55 AM, bdiz <
reply@reply.github.com

wrote:

It appeared, just from resizing/re-running, that the wrapping
algorithm is fixed. I'm using 2.0.0.rc2 with tcsh. There is no
$COLUMNS but stty size works.

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:16 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Is the wrap not working? It should use the COLUMNS environment
variable, or stty size if that is not available. What shell are you
using?


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)

@davetron5000
Copy link
Owner

Ah, I see. When I run a gli app under tcsh, it seems to wrap things fine.

It's possible that GLI doesn't think the stty command exists in your
environment. Here's how it determines that:

ENV['PATH'].split(File::PATH_SEPARATOR).any? {|dir| File.exists?
File.join(dir, command) }

Can you try that in IRB (or as a debug statement in your app) and see what
it does? For me, on OS X, it's /bin/stty.

I'm wondering if it's only working as a shell built-in for you, it doesn't
get detected…

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog
Fork me on Github: http://davetron5000.github.com

On Mon, Jul 9, 2012 at 11:01 AM, bdiz <
reply@reply.github.com

wrote:

I'm sorry. By "fixed" I meant "width is unchanging". :)

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:58 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Cool. I cribbed the algorithm from another project, but it's intended to
work in most reasonable shells (which includes tcsh :).

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog Fork me on Github:
http://davetron5000.github.com

On Mon, Jul 9, 2012 at 10:55 AM, bdiz <
reply@reply.github.com

wrote:

It appeared, just from resizing/re-running, that the wrapping
algorithm is fixed. I'm using 2.0.0.rc2 with tcsh. There is no
$COLUMNS but stty size works.

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:16 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Is the wrap not working? It should use the COLUMNS environment
variable, or stty size if that is not available. What shell are you
using?


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)

@bdiz
Copy link
Author

bdiz commented Jul 10, 2012

irb(main):004:0> ENV['PATH'].split(File::PATH_SEPARATOR).any? {|dir| File.exists? File.join(dir, 'stty') }
=> true

Seems ok.
-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 8:11 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc wrap formatter. (#100)

Ah, I see. When I run a gli app under tcsh, it seems to wrap things fine.

It's possible that GLI doesn't think the stty command exists in your environment. Here's how it determines that:

ENV['PATH'].split(File::PATH_SEPARATOR).any? {|dir| File.exists?
File.join(dir, command) }

Can you try that in IRB (or as a debug statement in your app) and see what it does? For me, on OS X, it's /bin/stty.

I'm wondering if it's only working as a shell built-in for you, it doesn't get detected…

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog Fork me on Github: http://davetron5000.github.com

On Mon, Jul 9, 2012 at 11:01 AM, bdiz <
reply@reply.github.com

wrote:

I'm sorry. By "fixed" I meant "width is unchanging". :)

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:58 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Cool. I cribbed the algorithm from another project, but it's intended
to work in most reasonable shells (which includes tcsh :).

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog Fork me on Github:
http://davetron5000.github.com

On Mon, Jul 9, 2012 at 10:55 AM, bdiz < reply@reply.github.com

wrote:

It appeared, just from resizing/re-running, that the wrapping
algorithm is fixed. I'm using 2.0.0.rc2 with tcsh. There is no
$COLUMNS but stty size works.

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:16 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Is the wrap not working? It should use the COLUMNS environment
variable, or stty size if that is not available. What shell are you
using?


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)

@davetron5000
Copy link
Owner

That is very strange. Any chance you are the STDIN? The code checks if
STDIN is a tty and, if not, will not do any word-wrapping. That might not
be correct behavior, now that I think about it, but it could explain what
you are seeing…

Dave

On Tue, Jul 10, 2012 at 12:20 AM, bdiz <
reply@reply.github.com

wrote:

irb(main):004:0> ENV['PATH'].split(File::PATH_SEPARATOR).any? {|dir|
File.exists? File.join(dir, 'stty') }
=> true

Seems ok.
-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 8:11 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Ah, I see. When I run a gli app under tcsh, it seems to wrap things fine.

It's possible that GLI doesn't think the stty command exists in your
environment. Here's how it determines that:

ENV['PATH'].split(File::PATH_SEPARATOR).any? {|dir| File.exists?
File.join(dir, command) }

Can you try that in IRB (or as a debug statement in your app) and see what
it does? For me, on OS X, it's /bin/stty.

I'm wondering if it's only working as a shell built-in for you, it doesn't
get detected…

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog Fork me on Github:
http://davetron5000.github.com

On Mon, Jul 9, 2012 at 11:01 AM, bdiz <
reply@reply.github.com

wrote:

I'm sorry. By "fixed" I meant "width is unchanging". :)

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:58 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Cool. I cribbed the algorithm from another project, but it's intended
to work in most reasonable shells (which includes tcsh :).

Dave


Buy My Book: http://www.awesomecommandlineapps.com
My Blog: http://www.naildrivin5.com/blog Fork me on Github:
http://davetron5000.github.com

On Mon, Jul 9, 2012 at 10:55 AM, bdiz < reply@reply.github.com

wrote:

It appeared, just from resizing/re-running, that the wrapping
algorithm is fixed. I'm using 2.0.0.rc2 with tcsh. There is no
$COLUMNS but stty size works.

-----Original Message-----
From: David Copeland [mailto:reply@reply.github.com]
Sent: Monday, July 09, 2012 7:16 AM
To: Delsol, Ben
Subject: Re: [gli] Enhancement request to switch off command long_desc
wrap formatter. (#100)

Is the wrap not working? It should use the COLUMNS environment
variable, or stty size if that is not available. What shell are you
using?


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)


Reply to this email directly or view it on GitHub:
#100 (comment)

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