After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 610241 - [gjs-console] Add a --command/-c argument
[gjs-console] Add a --command/-c argument
Status: RESOLVED FIXED
Product: gjs
Classification: Bindings
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gjs-maint
gjs-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-17 10:55 UTC by Johan (not receiving bugmail) Dahlin
Modified: 2010-02-17 12:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[gjs-console] Add a --command/-c argument (1.51 KB, patch)
2010-02-17 10:56 UTC, Johan (not receiving bugmail) Dahlin
accepted-commit_now Details | Review
[gjs-console] Add a --command/-c argument (1.51 KB, patch)
2010-02-17 12:00 UTC, Johan (not receiving bugmail) Dahlin
committed Details | Review

Description Johan (not receiving bugmail) Dahlin 2010-02-17 10:55:59 UTC
Add a command argument which allows you to specify a program
as a string on the command line. This is similar to what python
does.
Comment 1 Johan (not receiving bugmail) Dahlin 2010-02-17 10:56:03 UTC
Created attachment 154013 [details] [review]
[gjs-console] Add a --command/-c argument
Comment 2 Tommi Komulainen 2010-02-17 11:48:23 UTC
Review of attachment 154013 [details] [review]:

Looks good enough anyhow.

::: gjs/console.c
@@ +35,3 @@
     { "include-path", 'I', 0, G_OPTION_ARG_STRING_ARRAY, &include_path, "Add the directory DIR to the list of directories to search for js files.", "DIR" },
 static GOptionEntry entries[] = {
+    { "command", 'c', 0, G_OPTION_ARG_STRING, &command, "Program passed in as a string", "PROGRAM" },

Bit inconsistent with command vs. program terminology. Pick one and stick with it?

@@ +78,2 @@
         g_printerr("Failed to defined ARGV: %s", error->message);
                                          &error)) {

Not in this patch, but I think way ARGV is defined isn't right with argc < 2.
Comment 3 Johan (not receiving bugmail) Dahlin 2010-02-17 12:00:46 UTC
The following fix has been pushed:
a5fc606 [gjs-console] Add a --command/-c argument
Comment 4 Johan (not receiving bugmail) Dahlin 2010-02-17 12:00:58 UTC
Created attachment 154022 [details] [review]
[gjs-console] Add a --command/-c argument

Add a command argument which allows you to specify a program
as a string on the command line. This is similar to what python
does.