@@ -8,72 +8,72 @@ export async function editCommand(hostName?: string) {
88 const config = await loadConfig ( ) ;
99
1010 if ( config . hosts . length === 0 ) {
11- console . log ( chalk . yellow ( '⚠️ 저장된 호스트가 없습니다 .' ) ) ;
11+ console . log ( chalk . yellow ( '⚠️ No saved hosts found .' ) ) ;
1212 return ;
1313 }
1414
1515 let targetHostName = hostName ;
1616
1717 if ( ! targetHostName ) {
18- // 호스트 선택
18+ // Host selection
1919 const { selectedHost } = await inquirer . prompt ( [
2020 {
2121 type : 'list' ,
2222 name : 'selectedHost' ,
23- message : '편집할 호스트를 선택하세요 :' ,
23+ message : 'Select host to edit :' ,
2424 choices : [
2525 ...config . hosts . map ( host => ( {
2626 name : `${ chalk . cyan ( host . name ) } - ${ host . user } @${ host . host } :${ host . port } ` ,
2727 value : host . name ,
2828 } ) ) ,
2929 new inquirer . Separator ( ) ,
3030 {
31- name : chalk . gray ( '취소 ' ) ,
31+ name : chalk . gray ( 'Cancel ' ) ,
3232 value : null ,
3333 } ,
3434 ] ,
3535 } ,
3636 ] ) ;
3737
3838 if ( ! selectedHost ) {
39- console . log ( chalk . blue ( '취소되었습니다 .' ) ) ;
39+ console . log ( chalk . blue ( 'Cancelled .' ) ) ;
4040 return ;
4141 }
4242
4343 targetHostName = selectedHost ;
4444 }
4545
4646 if ( ! targetHostName ) {
47- console . log ( chalk . red ( '❌ 호스트 이름이 지정되지 않았습니다 .' ) ) ;
47+ console . log ( chalk . red ( '❌ Host name not specified .' ) ) ;
4848 return ;
4949 }
5050
5151 const targetHost = await getHost ( targetHostName ) ;
5252 if ( ! targetHost ) {
53- console . log ( chalk . red ( `❌ 호스트 '${ targetHostName } '을 찾을 수 없습니다 .` ) ) ;
53+ console . log ( chalk . red ( `❌ Host '${ targetHostName } ' not found .` ) ) ;
5454 return ;
5555 }
5656
57- console . log ( chalk . blue ( `✏️ 호스트 '${ targetHost . name } ' 편집 ` ) ) ;
58- console . log ( chalk . dim ( '(변경하지 않으려면 Enter를 누르세요 )' ) ) ;
57+ console . log ( chalk . blue ( `✏️ Edit host '${ targetHost . name } '` ) ) ;
58+ console . log ( chalk . dim ( '(Press Enter to keep current value )' ) ) ;
5959 console . log ( ) ;
6060
6161 const answers = await inquirer . prompt ( [
6262 {
6363 type : 'input' ,
6464 name : 'name' ,
65- message : '호스트 이름 (별칭 ):' ,
65+ message : 'Host name (alias ):' ,
6666 default : targetHost . name ,
6767 validate : ( input : string ) => {
6868 if ( ! input || ! input . trim ( ) ) {
69- return '호스트 이름을 입력해주세요 .' ;
69+ return 'Please enter a host name .' ;
7070 }
7171
72- // 현재 호스트가 아닌 다른 호스트와 중복 체크
72+ // Check for duplicates with other hosts
7373 if ( input . trim ( ) !== targetHost . name ) {
7474 const exists = config . hosts . some ( h => h . name === input . trim ( ) ) ;
7575 if ( exists ) {
76- return `'${ input . trim ( ) } ' 이름은 이미 사용 중입니다. 다른 이름을 선택해주세요 .` ;
76+ return `Host name '${ input . trim ( ) } ' already exists. Please choose a different name .` ;
7777 }
7878 }
7979
@@ -84,11 +84,11 @@ export async function editCommand(hostName?: string) {
8484 {
8585 type : 'input' ,
8686 name : 'host' ,
87- message : '호스트 주소 (IP 또는 도메인 ):' ,
87+ message : 'Host address (IP or domain ):' ,
8888 default : targetHost . host ,
8989 validate : ( input : string ) => {
9090 if ( ! input . trim ( ) ) {
91- return '호스트 주소를 입력해주세요 .' ;
91+ return 'Please enter a host address .' ;
9292 }
9393 return true ;
9494 } ,
@@ -97,11 +97,11 @@ export async function editCommand(hostName?: string) {
9797 {
9898 type : 'input' ,
9999 name : 'user' ,
100- message : '사용자명 :' ,
100+ message : 'Username :' ,
101101 default : targetHost . user ,
102102 validate : ( input : string ) => {
103103 if ( ! input . trim ( ) ) {
104- return '사용자명을 입력해주세요 .' ;
104+ return 'Please enter a username .' ;
105105 }
106106 return true ;
107107 } ,
@@ -110,12 +110,12 @@ export async function editCommand(hostName?: string) {
110110 {
111111 type : 'input' ,
112112 name : 'port' ,
113- message : '포트 번호 :' ,
113+ message : 'Port number :' ,
114114 default : targetHost . port . toString ( ) ,
115115 validate : ( input : string ) => {
116116 const port = parseInt ( input ) ;
117117 if ( isNaN ( port ) || port < 1 || port > 65535 ) {
118- return '올바른 포트 번호를 입력해주세요 (1-65535).' ;
118+ return 'Please enter a valid port number (1-65535).' ;
119119 }
120120 return true ;
121121 } ,
@@ -124,11 +124,11 @@ export async function editCommand(hostName?: string) {
124124 {
125125 type : 'list' ,
126126 name : 'authMethod' ,
127- message : '인증 방식을 선택하세요 :' ,
127+ message : 'Select authentication method :' ,
128128 choices : [
129- { name : 'SSH 키 파일 사용 (권장 )' , value : 'key' } ,
130- { name : '비밀번호 사용 (연결 시 입력 )' , value : 'password' } ,
131- { name : '기본 SSH 설정 사용 ' , value : 'default' } ,
129+ { name : 'SSH key file (recommended )' , value : 'key' } ,
130+ { name : 'Password (prompt on connect )' , value : 'password' } ,
131+ { name : 'Default SSH settings ' , value : 'default' } ,
132132 ] ,
133133 default : ( ) => {
134134 if ( targetHost . keyPath ) return 'key' ;
@@ -139,15 +139,15 @@ export async function editCommand(hostName?: string) {
139139 {
140140 type : 'input' ,
141141 name : 'keyPath' ,
142- message : 'SSH 키 파일 경로 :' ,
142+ message : 'SSH key file path :' ,
143143 when : answers => answers . authMethod === 'key' ,
144144 default : targetHost . keyPath || '' ,
145145 validate : ( input : string ) => {
146146 if ( ! input || ! input . trim ( ) ) {
147- return 'SSH 키 파일 경로를 입력해주세요 .' ;
147+ return 'Please enter SSH key file path .' ;
148148 }
149149 if ( ! existsSync ( input . trim ( ) ) ) {
150- return '지정한 키 파일이 존재하지 않습니다 .' ;
150+ return 'The specified key file does not exist .' ;
151151 }
152152 return true ;
153153 } ,
@@ -156,14 +156,14 @@ export async function editCommand(hostName?: string) {
156156 {
157157 type : 'input' ,
158158 name : 'description' ,
159- message : '설명 (선택사항 ):' ,
159+ message : 'Description (optional ):' ,
160160 default : targetHost . description || '' ,
161161 filter : ( input : string ) => input . trim ( ) || undefined ,
162162 } ,
163163 {
164164 type : 'input' ,
165165 name : 'tags' ,
166- message : '태그 (쉼표로 구분, 선택사항 ):' ,
166+ message : 'Tags (comma-separated, optional ):' ,
167167 default : targetHost . tags ? targetHost . tags . join ( ', ' ) : '' ,
168168 filter : ( input : string ) => {
169169 if ( ! input . trim ( ) ) return undefined ;
@@ -189,24 +189,23 @@ export async function editCommand(hostName?: string) {
189189 try {
190190 await addHost ( updatedHost ) ;
191191
192+ console . log ( chalk . green ( '✅ Host updated successfully!' ) ) ;
192193 console . log ( ) ;
193- console . log ( chalk . green ( '✅ 호스트가 성공적으로 수정되었습니다!' ) ) ;
194- console . log ( ) ;
195- console . log ( chalk . blue ( '📋 수정된 호스트 정보:' ) ) ;
196- console . log ( ` ${ chalk . cyan ( '이름:' ) } ${ updatedHost . name } ` ) ;
197- console . log ( ` ${ chalk . cyan ( '주소:' ) } ${ updatedHost . user } @${ updatedHost . host } :${ updatedHost . port } ` ) ;
194+ console . log ( chalk . blue ( '📋 Updated host information:' ) ) ;
195+ console . log ( ` ${ chalk . cyan ( 'Name:' ) } ${ updatedHost . name } ` ) ;
196+ console . log ( ` ${ chalk . cyan ( 'Address:' ) } ${ updatedHost . user } @${ updatedHost . host } :${ updatedHost . port } ` ) ;
198197 if ( updatedHost . keyPath ) {
199- console . log ( ` ${ chalk . cyan ( '키 파일 :' ) } ${ updatedHost . keyPath } ` ) ;
198+ console . log ( ` ${ chalk . cyan ( 'Key file :' ) } ${ updatedHost . keyPath } ` ) ;
200199 }
201200 if ( updatedHost . description ) {
202- console . log ( ` ${ chalk . cyan ( '설명 :' ) } ${ updatedHost . description } ` ) ;
201+ console . log ( ` ${ chalk . cyan ( 'Description :' ) } ${ updatedHost . description } ` ) ;
203202 }
204203 if ( updatedHost . tags && updatedHost . tags . length > 0 ) {
205- console . log ( ` ${ chalk . cyan ( '태그 :' ) } ${ updatedHost . tags . join ( ', ' ) } ` ) ;
204+ console . log ( ` ${ chalk . cyan ( 'Tags :' ) } ${ updatedHost . tags . join ( ', ' ) } ` ) ;
206205 }
207206 console . log ( ) ;
208- console . log ( chalk . blue ( '💡 연결하려면 :' ) , chalk . gray ( `simple-ssh connect ${ updatedHost . name } ` ) ) ;
207+ console . log ( chalk . blue ( '💡 To connect :' ) , chalk . gray ( `simple-ssh connect ${ updatedHost . name } ` ) ) ;
209208 } catch ( error ) {
210- console . log ( chalk . red ( '❌ 호스트 수정 중 오류가 발생했습니다 :' ) , error ) ;
209+ console . log ( chalk . red ( '❌ Error updating host :' ) , error ) ;
211210 }
212211}
0 commit comments