[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Rename the load command to source

From: Darshit Shah
Subject: [PATCH] Rename the load command to source
Date: Sun, 12 Jan 2020 11:09:59 +0100

From: Darshit Shah <address@hidden>

As discussed and decided during the GNU Hackers' Meeting, Jan 2020, we
should rename the "load" command to "source". This makes the verb be
more in-line with what the command really does.

This patch does not currently change the --load command line switch.
Renaming it to --source is easy, but I don't like making the short
switch -S or leaving it as -l. So I'm currently looking for ideas on how
to deal with it.

Patch follows:

The "load" verb is unintuitive for what it does. Especially since it
will fail when the same pickle is "loaded" multiple times. This patch
instead renames it to "source" to be more in-line with shell. Since the
action is similar to what the "source" directive does in the Bourne

* src/pk-cmd.c(dot_cmds): Rename the load command to source
* src/pk-file.c(pk_cmd_load_file):  Same
 src/pk-cmd.c  | 4 ++--
 src/pk-file.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/pk-cmd.c b/src/pk-cmd.c
index 10286788..b2795362 100644
--- a/src/pk-cmd.c
+++ b/src/pk-cmd.c
@@ -43,7 +43,7 @@
 extern struct pk_cmd file_cmd; /* pk-file.c  */
 extern struct pk_cmd close_cmd; /* pk-file.c */
-extern struct pk_cmd load_cmd; /* pk-file.c */
+extern struct pk_cmd source_cmd; /* pk-file.c */
 extern struct pk_cmd info_cmd; /* pk-info.c  */
 extern struct pk_cmd exit_cmd; /* pk-misc.c  */
 extern struct pk_cmd version_cmd; /* pk-misc.c */
@@ -61,7 +61,7 @@ static struct pk_cmd *dot_cmds[] =
-    &load_cmd,
+    &source_cmd,
diff --git a/src/pk-file.c b/src/pk-file.c
index 39939491..fa0cc8f2 100644
--- a/src/pk-file.c
+++ b/src/pk-file.c
@@ -251,7 +251,7 @@ pk_file_readable (const char *filename)
 static int
-pk_cmd_load_file (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
+pk_cmd_source_file (int argc, struct pk_cmd_arg argv[], uint64_t uflags)
   /* load FILENAME */
@@ -304,5 +304,5 @@ struct pk_cmd close_cmd =
 struct pk_cmd info_files_cmd =
   {"files", "", "", 0, NULL, pk_cmd_info_files, "info files"};
-struct pk_cmd load_cmd =
-  {"load", "f", "", 0, NULL, pk_cmd_load_file, "load FILENAME", 
+struct pk_cmd source_cmd =
+  {"source", "f", "", 0, NULL, pk_cmd_source_file, "source FILENAME", 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]