From 3f88e0258727f432f535ec2896af3280ea5da0d5 Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Mon, 1 Jun 2015 15:22:56 -0700 Subject: [PATCH] New: added the option -n to specify the name of the cocoa files generated by objj2objcskeleton --- Tools/objj2objcskeleton/objj2objcskeleton | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Tools/objj2objcskeleton/objj2objcskeleton b/Tools/objj2objcskeleton/objj2objcskeleton index 105b49573..30f96c0ee 100644 --- a/Tools/objj2objcskeleton/objj2objcskeleton +++ b/Tools/objj2objcskeleton/objj2objcskeleton @@ -4,9 +4,7 @@ var FILE = require("file"), OS = require("os"), - stream = require("narwhal/term").stream, - - SLASH_REPLACEMENT = "∕"; // DIVISION SLASH, Unicode: U+2215 + stream = require("narwhal/term").stream; function main(args) { @@ -138,16 +136,17 @@ function removeLastSlashIfNecessary(path) /* $1 Full project source path $2 Destination + $-n name of the cocoa files */ function parser(args) { try { - var projectBasePath = removeLastSlashIfNecessary(args[1]), - sourcePath = args[0], + var sourcePath = args.shift(), + projectBasePath = removeLastSlashIfNecessary(args.shift()), outputDirectory = projectBasePath, baseFilename = [sourcePath lastPathComponent], - baseFilenameWithNoExtension = baseFilename.substring(0, baseFilename.length - 2), + baseFilenameWithNoExtension = args.shift() == "-n" ? args.shift() : baseFilename.substring(0, baseFilename.length - 2), outputHeaderURL = new CFURL([outputDirectory stringByAppendingPathComponent:baseFilenameWithNoExtension + ".h"]), outputImplementationURL = new CFURL([outputDirectory stringByAppendingPathComponent:baseFilenameWithNoExtension + ".m"]), source = FILE.read(sourcePath, { charset: "UTF-8" }),