Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread Eric Schrock
This is a known problem:

6349494 'zfs list' output annoying for even moderately long dataset names

The fix is fairly straightforward.  We don't need some complicated
method of specifying columns widths.  We just need to do two passes over
the data (which we already have in hand for sorting purposes) to find
out the maximum length of each column.

- Eric

On Mon, Jul 10, 2006 at 09:58:46AM -0400, Jeff Victor wrote:
> 
> 
> 
> My interpretation: more specific control of column widths and flexibility 
> to place the name in the first column.  Further, to many people, tabs are 
> evil.
> 
> For example, instead of:
> 
> bash-3.00# zfs list
> NAME   USED  AVAIL  REFER  MOUNTPOINT
> dns-pool   197K  43.1G  25.5K  /dns-pool
> dns-pool/zones 100K  43.1G  25.5K  /dns-pool/zones
> dns-pool/zones/dns1   74.5K  43.1G  25.5K  /dns-pool/zones/dns1
> dns-pool/zones/dns1/local  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/local
> dns-pool/zones/dns1/root  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/root
> 
> 
> the desire is for:
> 
> bash-3.00# zfs list
> NAME   USED   AVAIL  REFER  MOUNTPOINT
> dns-pool   197K   43.1G  25.5K  /dns-pool
> dns-pool/zones 100K   43.1G  25.5K  /dns-pool/zones
> dns-pool/zones/dns174.5K  43.1G  25.5K  /dns-pool/zones/dns1
> dns-pool/zones/dns1/local  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/local
> dns-pool/zones/dns1/root   24.5K  43.1G  24.5K  /dns-pool/zones/dns1/root
> 
> 
> I suggested a syntax similar to "ps -o ", viz:
> 
> zfs list -o \
> name="NAME---",used="USED",available,referenced,mountpoint
> 
> Users would probably specify spaces instead of hyphens, but it is difficult 
> to show that effectively in word-wrapped e-mail readers.

--
Eric Schrock, Solaris Kernel Development   http://blogs.sun.com/eschrock
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread David Bustos
Quoth [EMAIL PROTECTED] on Mon, Jul 10, 2006 at 10:33:44AM +0200:
...
> I would like to customise column width to have nicer view of the hierarchy.
> Wouldn't be good to have some sort of configuration file in which I could set 
> up the column
> width ?

No.  You want zfs to keep the columns aligned by expanding
appropriately.

  6349494 'zfs list' output annoying for even moderately long dataset names


David
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread Darren J Moffat

Darren Reed wrote:
The width of the columns.  Create a ZFS filesystem called 
cube/builds/example_with_a_long_name and put that in the middle of your 
output.


Even with one tab, that doesn't quite work for tty output.



The whole point of the -H is so that you can post process it to suit, 
for example:


$ zenity --list --title="ZFS File systems" --column NAME --column 
MOUNTPOINT --column USED --column AVAIL `zfs list -t filesystem -H -o 
name,mountpoint,used,avail`


Okay so that isn't tty but it solves the column width problem nicely :-)

--
Darren J Moffat
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread Darren J Moffat

Jeff Victor wrote:
My interpretation: more specific control of column widths and 
flexibility to place the name in the first column.  Further, to many 
people, tabs are evil.


Putting the name in the first column is easy it works already:

zfs list -o name,used,avail,refer,mountpoint

Granted that doesn't give you the spacing.

I now understand the ps -o reference it is about the key=format part not 
just the ability to choose which fields and the order.


--
Darren J Moffat

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread Jeff Victor



Darren J Moffat wrote:

Jeff Victor wrote:


[EMAIL PROTECTED] wrote:


bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   136K  43.1G  25.5K  /dns-pool
dns-pool/zones  50K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   24.5K  43.1G  24.5K  /dns-pool/zones/dns1

But if I want bigger hierarchy (for sure I will !) 'zfs list' 
becomes less readable:


 

I would like to customise column width to have nicer view of the 
hierarchy.
Wouldn't be good to have some sort of configuration file in which I 
could set up the column

width ?



What about an environment variable so that non-root can also 
customise their view?



That's even better idea ! Or config file per user 
(~/.zfs*-something). 'zfs'

would read that file and format data before displaying them.



Perhaps this should be left entirely under user control using the 
method that "ps -o format" uses.  Why reinvent the wheel?




$ zfs list -r -o used,referenced,available,name,mountpoint cube/builds

I must be missing something here because that command works just fine.
If you use -H as well there is always one tab between each column.

What is the actually problem here that the existing list -o doesn't
solve ?


My interpretation: more specific control of column widths and flexibility to place 
the name in the first column.  Further, to many people, tabs are evil.


For example, instead of:

bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   197K  43.1G  25.5K  /dns-pool
dns-pool/zones 100K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   74.5K  43.1G  25.5K  /dns-pool/zones/dns1
dns-pool/zones/dns1/local  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/local
dns-pool/zones/dns1/root  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/root


the desire is for:

bash-3.00# zfs list
NAME   USED   AVAIL  REFER  MOUNTPOINT
dns-pool   197K   43.1G  25.5K  /dns-pool
dns-pool/zones 100K   43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns174.5K  43.1G  25.5K  /dns-pool/zones/dns1
dns-pool/zones/dns1/local  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/local
dns-pool/zones/dns1/root   24.5K  43.1G  24.5K  /dns-pool/zones/dns1/root


I suggested a syntax similar to "ps -o ", viz:

zfs list -o \
name="NAME---",used="USED",available,referenced,mountpoint

Users would probably specify spaces instead of hyphens, but it is difficult to 
show that effectively in word-wrapped e-mail readers.



--
--
Jeff VICTOR  Sun Microsystemsjeff.victor @ sun.com
OS AmbassadorSr. Technical Specialist
Solaris 10 Zones FAQ:http://www.opensolaris.org/os/community/zones/faq
--
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread Darren Reed

Darren J Moffat wrote:


Jeff Victor wrote:


[EMAIL PROTECTED] wrote:


bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   136K  43.1G  25.5K  /dns-pool
dns-pool/zones  50K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   24.5K  43.1G  24.5K  /dns-pool/zones/dns1

But if I want bigger hierarchy (for sure I will !) 'zfs list' 
becomes less readable:



 

I would like to customise column width to have nicer view of the 
hierarchy.
Wouldn't be good to have some sort of configuration file in which 
I could set up the column

width ?



What about an environment variable so that non-root can also 
customise their view?



That's even better idea ! Or config file per user 
(~/.zfs*-something). 'zfs'

would read that file and format data before displaying them.



Perhaps this should be left entirely under user control using the 
method that "ps -o format" uses.  Why reinvent the wheel?




$ zfs list -r -o used,referenced,available,name,mountpoint cube/builds

I must be missing something here because that command works just fine.
If you use -H as well there is always one tab between each column.

What is the actually problem here that the existing list -o doesn't
solve ?



The width of the columns.  Create a ZFS filesystem called 
cube/builds/example_with_a_long_name and put that in the middle of your 
output.


Even with one tab, that doesn't quite work for tty output.

Darren

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread Darren J Moffat

Jeff Victor wrote:

[EMAIL PROTECTED] wrote:

bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   136K  43.1G  25.5K  /dns-pool
dns-pool/zones  50K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   24.5K  43.1G  24.5K  /dns-pool/zones/dns1

But if I want bigger hierarchy (for sure I will !) 'zfs list' 
becomes less readable:


I would like to customise column width to have nicer view of the 
hierarchy.
Wouldn't be good to have some sort of configuration file in which I 
could set up the column

width ?


What about an environment variable so that non-root can also 
customise their view?


That's even better idea ! Or config file per user (~/.zfs*-something). 
'zfs'

would read that file and format data before displaying them.


Perhaps this should be left entirely under user control using the method 
that "ps -o format" uses.  Why reinvent the wheel?



$ zfs list -r -o used,referenced,available,name,mountpoint cube/builds

I must be missing something here because that command works just fine.
If you use -H as well there is always one tab between each column.

What is the actually problem here that the existing list -o doesn't
solve ?

--
Darren J Moffat
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread Jeff Victor



[EMAIL PROTECTED] wrote:

On Mon, Jul 10, 2006 at 05:07:35PM +0800, Darren Reed wrote:


[EMAIL PROTECTED] wrote:



Hello,

because creating/using filesystems in ZFS becoms "cheap" it is useful now
to create/organize filesystems in hierarchy:

bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   136K  43.1G  25.5K  /dns-pool
dns-pool/zones  50K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   24.5K  43.1G  24.5K  /dns-pool/zones/dns1

But if I want bigger hierarchy (for sure I will !) 'zfs list' becomes less 
readable:


bash-3.00# zfs create dns-pool/zones/dns1/root
bash-3.00# zfs create dns-pool/zones/dns1/local
bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   197K  43.1G  25.5K  /dns-pool
dns-pool/zones 100K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   74.5K  43.1G  25.5K  /dns-pool/zones/dns1
dns-pool/zones/dns1/local  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/local
dns-pool/zones/dns1/root  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/root

I would like to customise column width to have nicer view of the hierarchy.
Wouldn't be good to have some sort of configuration file in which I could 
set up the column

width ?


What about an environment variable so that non-root can also customise 
their view?


That's even better idea ! Or config file per user (~/.zfs*-something). 'zfs'
would read that file and format data before displaying them.


Perhaps this should be left entirely under user control using the method that "ps 
-o format" uses.  Why reinvent the wheel?




--
Jeff VICTOR  Sun Microsystemsjeff.victor @ sun.com
OS AmbassadorSr. Technical Specialist
Solaris 10 Zones FAQ:http://www.opensolaris.org/os/community/zones/faq
--
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread przemolicc
On Mon, Jul 10, 2006 at 05:07:35PM +0800, Darren Reed wrote:
> [EMAIL PROTECTED] wrote:
> 
> >Hello,
> >
> >because creating/using filesystems in ZFS becoms "cheap" it is useful now
> >to create/organize filesystems in hierarchy:
> >
> >bash-3.00# zfs list
> >NAME   USED  AVAIL  REFER  MOUNTPOINT
> >dns-pool   136K  43.1G  25.5K  /dns-pool
> >dns-pool/zones  50K  43.1G  25.5K  /dns-pool/zones
> >dns-pool/zones/dns1   24.5K  43.1G  24.5K  /dns-pool/zones/dns1
> >
> >But if I want bigger hierarchy (for sure I will !) 'zfs list' becomes less 
> >readable:
> >
> >bash-3.00# zfs create dns-pool/zones/dns1/root
> >bash-3.00# zfs create dns-pool/zones/dns1/local
> >bash-3.00# zfs list
> >NAME   USED  AVAIL  REFER  MOUNTPOINT
> >dns-pool   197K  43.1G  25.5K  /dns-pool
> >dns-pool/zones 100K  43.1G  25.5K  /dns-pool/zones
> >dns-pool/zones/dns1   74.5K  43.1G  25.5K  /dns-pool/zones/dns1
> >dns-pool/zones/dns1/local  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/local
> >dns-pool/zones/dns1/root  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/root
> >
> >I would like to customise column width to have nicer view of the hierarchy.
> >Wouldn't be good to have some sort of configuration file in which I could 
> >set up the column
> >width ?
> 
> What about an environment variable so that non-root can also customise 
> their view?

That's even better idea ! Or config file per user (~/.zfs*-something). 'zfs'
would read that file and format data before displaying them.

przemol
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] zfs list - column width

2006-07-10 Thread Darren Reed

[EMAIL PROTECTED] wrote:


Hello,

because creating/using filesystems in ZFS becoms "cheap" it is useful now
to create/organize filesystems in hierarchy:

bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   136K  43.1G  25.5K  /dns-pool
dns-pool/zones  50K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   24.5K  43.1G  24.5K  /dns-pool/zones/dns1

But if I want bigger hierarchy (for sure I will !) 'zfs list' becomes less 
readable:

bash-3.00# zfs create dns-pool/zones/dns1/root
bash-3.00# zfs create dns-pool/zones/dns1/local
bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   197K  43.1G  25.5K  /dns-pool
dns-pool/zones 100K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   74.5K  43.1G  25.5K  /dns-pool/zones/dns1
dns-pool/zones/dns1/local  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/local
dns-pool/zones/dns1/root  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/root

I would like to customise column width to have nicer view of the hierarchy.
Wouldn't be good to have some sort of configuration file in which I could set 
up the column
width ?
 



What about an environment variable so that non-root can also customise 
their view?


Darren

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


[zfs-discuss] zfs list - column width

2006-07-10 Thread przemolicc
Hello,

because creating/using filesystems in ZFS becoms "cheap" it is useful now
to create/organize filesystems in hierarchy:

bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   136K  43.1G  25.5K  /dns-pool
dns-pool/zones  50K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   24.5K  43.1G  24.5K  /dns-pool/zones/dns1

But if I want bigger hierarchy (for sure I will !) 'zfs list' becomes less 
readable:

bash-3.00# zfs create dns-pool/zones/dns1/root
bash-3.00# zfs create dns-pool/zones/dns1/local
bash-3.00# zfs list
NAME   USED  AVAIL  REFER  MOUNTPOINT
dns-pool   197K  43.1G  25.5K  /dns-pool
dns-pool/zones 100K  43.1G  25.5K  /dns-pool/zones
dns-pool/zones/dns1   74.5K  43.1G  25.5K  /dns-pool/zones/dns1
dns-pool/zones/dns1/local  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/local
dns-pool/zones/dns1/root  24.5K  43.1G  24.5K  /dns-pool/zones/dns1/root

I would like to customise column width to have nicer view of the hierarchy.
Wouldn't be good to have some sort of configuration file in which I could set 
up the column
width ?

przemol
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss