Re: [parted-devel] print all --list

2006-12-11 Thread Otavio Salvador
Debarshi Ray [EMAIL PROTECTED] writes:

 Here is the patch.

 Any outstanding issues with this one?

I think it's ok.

-- 
O T A V I OS A L V A D O R
-
 E-mail: [EMAIL PROTECTED]  UIN: 5906116
 GNU/Linux User: 239058 GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
-
Microsoft sells you Windows ... Linux gives
 you the whole house.

___
parted-devel mailing list
parted-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/parted-devel


Re: [parted-devel] print all --list

2006-12-09 Thread leslie . polzer
On Sat, Dec 09, 2006 at 11:35:56AM -0200, Otavio Salvador wrote:

  Leslie, I hope I am correct. :-)

 I think you are correct here. Does someone see this differently?
Everything's alright with that.


-- 
gpg --keyserver pgp.mit.edu --recv-keys DD4EBF83
http://nic-nac-project.de/~skypher/


pgphurHn7GaPe.pgp
Description: PGP signature
___
parted-devel mailing list
parted-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/parted-devel

Re: [parted-devel] print all --list

2006-12-08 Thread Debarshi Ray

Here is the patch.

Happy hacking,
Debarshi
--
Universities are places of knowledge.  The freshman each bring a
little in with them, and the seniors take none away, so knowledge
accumulates.
From 89345ab4758fa6d305aa6ef2b5968ea1a4ca265c Mon Sep 17 00:00:00 2001
From: Debarshi Ray [EMAIL PROTECTED]
Date: Sat, 9 Dec 2006 01:11:49 +0530
Subject: Alias 'print list' with 'print all'.

---
 parted/parted.c |   52 ++--
 1 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/parted/parted.c b/parted/parted.c
index 7e259f2..4e68ce0 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -127,7 +127,7 @@ static Command* commands [256] = {NULL};
 static PedTimer* timer;
 static TimerContext timer_context;
 
-static int _print_all (int cli);
+static int _print_list (int cli);
 static void _done (PedDevice* dev);
 
 static void
@@ -1219,9 +1219,9 @@ do_print (PedDevice** dev)
 StrList*row;
 int has_extended;
 int has_name;
-int has_all_arg = 0;
 int has_devices_arg = 0;
 int has_free_arg = 0;
+int has_list_arg = 0;
 int has_num_arg = 0;
 char*   transport[13] = {unknown, scsi, ide, dac960,
  cpqarray, file, ataraid, i2o,
@@ -1240,31 +1240,26 @@ do_print (PedDevice** dev)
 
 peek_word = command_line_peek_word ();
 if (peek_word) {
-has_num_arg = isdigit (peek_word[0]);
-
-if (strncmp (peek_word, all, 3) == 0) {
-command_line_pop_word();
-has_all_arg = 1;
-}
-
-else if (strncmp (peek_word, devices, 7) == 0) {
+if (strncmp (peek_word, devices, 7) == 0) {
 command_line_pop_word();
 has_devices_arg = 1;
 }
-
 else if (strncmp (peek_word, free, 4) == 0) {
 command_line_pop_word ();
 has_free_arg = 1;
 } 
+else if (strncmp (peek_word, all, 3) == 0 ||
+ strncmp (peek_word, list, 4) == 0) {
+command_line_pop_word();
+has_list_arg = 1;
+}
+else
+has_num_arg = isdigit(peek_word[0]);
 
 ped_free (peek_word);
-
 }
 
-if (has_all_arg) 
-return _print_all (0);
-
-else if (has_devices_arg) {
+if (has_devices_arg) {
 PedDevice *current_dev = NULL;
 
 ped_device_probe_all();
@@ -1280,6 +1275,9 @@ do_print (PedDevice** dev)
 return 1;
 }
 
+else if (has_list_arg) 
+return _print_list (0);
+
 else if (has_num_arg) {
 PedPartition*   part = NULL;
 int status = 0;
@@ -1498,7 +1496,7 @@ error:
 }
 
 static int
-_print_all (int cli)
+_print_list (int cli)
 {
 PedDevice *current_dev = NULL;
 
@@ -2093,7 +2091,7 @@ NULL), 1));
 do_mkpartfs,
 str_list_create (
 _(mkpartfs PART-TYPE FS-TYPE START END make a partition with a 
-file system),
+  file system),
 NULL),
 str_list_create (_(part_type_msg), _(start_end_msg), NULL), 1));
 
@@ -2117,16 +2115,18 @@ command_register (commands, command_crea
 str_list_create_unique (print, _(print), NULL),
 do_print,
 str_list_create (
-_(print [NUMBER|all|devices|free]  display the partition table, 
+_(print [devices|free|list,all|NUMBER] display the partition table, 
   a partition, or all devices),
 NULL),
 str_list_create (
-_(Without arguments, print displays the entire partition table. With 
'devices',\n
-all the active block devices are listed, while with the argument 'free'\n
-information about free space will be displayed. If a partition number is 
given,\n
-then more detailed information is displayed about that partition. If the 
'all'\n
-argument is passed instead, partition information for all devices will be\n
-displayed.\n), NULL), 1));
+_(Without arguments, print displays the entire partition table. However 
+  with the following arguments it performs the various other actions.\n),
+_(a. devices : display all active block devices\n),
+_(b. free: display information about free unpartitioned space on the 
+  current block device\n),
+_(c. list,all: display partition tables of all active block devices\n),
+_(d. NUMBER  : display more detail information about particular partition\n),
+NULL), 1));
 
 command_register (commands, command_create (
 str_list_create_unique (quit, _(quit), NULL),
@@ -2259,7 +2259,7 @@ #endif
 
 switch (opt) {
 case 'h': help_msg (); break;
-case 

Re: [parted-devel] print all --list

2006-12-03 Thread Debarshi Ray

  Do you have any suggestions for solving this issue?


We can support 'print all' and 'print list' and --list. I am wary of
introducing the '--all/-a' switch since we might need '-a' in future
for some other purpose.

What do you say?

Cheers,
Debarshi
--
Universities are places of knowledge.  The freshman each bring a
little in with them, and the seniors take none away, so knowledge
accumulates.

___
parted-devel mailing list
parted-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/parted-devel


[parted-devel] print all --list

2006-12-02 Thread Debarshi Ray

I was just wondering about the fact that although 'print all' is the
command to display the disk labels of all active block devices, we use
the '--list' switch to do it from Bash. Should not there be a
similarity in nomenclature?

Any thoughts?

Happy hacking,
Debarshi
--
Universities are places of knowledge.  The freshman each bring a
little in with them, and the seniors take none away, so knowledge
accumulates.

___
parted-devel mailing list
parted-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/parted-devel