From 496514649ac52f805e6c419f0ee9e1f0d7f2b6f1 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Thu, 27 Jul 2023 13:03:02 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=82=D0=BA=D1=80=D1=8B=D1=82=D0=B8=D0=B5=20?= =?UTF-8?q?=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2=20=D1=81=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=BD=D1=8B=D0=BC=D0=B8=20=D0=BF=D1=83=D1=82=D1=8F=D0=BC?= =?UTF-8?q?=D0=B8=20(~/=20./=20../)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 2 ++ projman.tcl | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index bfd9e2c..61ad7ec 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -134,3 +134,5 @@ - Fixed saving user session and opening files and folders at the next start - Added buttons "Git clone" and "Git init" in the dialog box displayed when the Git button is pressed +27/07/2023 + - Fixed opening files and directoryes from command line if their name is relative diff --git a/projman.tcl b/projman.tcl index 2174e70..4b17874 100755 --- a/projman.tcl +++ b/projman.tcl @@ -10,7 +10,7 @@ exec wish "$0" -- "$@" ###################################################### # Version: 2.0.0 # Release: alpha -# Build: 06022023092717 +# Build: 27072023125916 ###################################################### # определим текущую версию, релиз и т.д. @@ -34,12 +34,6 @@ while {[gets $f line] >=0} { } close $f -if { $::argc > 0 } { - foreach arg $::argv { - lappend opened $arg - } - puts $opened -} package require msgcat package require inifile @@ -53,6 +47,15 @@ package require fileutil::magic::filetype set dir(root) [pwd] set dir(doc) [file join $dir(root) doc] +# ДОбавляем в список файлы (каталоги) из командной строки +if { $::argc > 0 } { + foreach arg $::argv { + lappend opened $arg + } + puts $opened +} + + # Устанавливаем рабочий каталог, если его нет то создаём. # Согласно спецификации XDG проверяем наличие переменных и каталогов if [info exists env(XDG_CONFIG_HOME)] { @@ -111,11 +114,10 @@ source [file join $dir(lib) gui.tcl] # Open the PATH if command line argument has been setting if [info exists opened] { - # puts ">$opened" foreach path $opened { + # Приводим путь к полному виду if {[file pathtype $path] ne "absolute"} { - puts "\n\t[::msgcat::mc "Specify the absolute path to the directory or file"]: $path\n" - exit + set path [file normalize $path] } if [file isdirectory $path] { # set activeProject $path